=================================================================== RCS file: /cvs/mandoc/mdoc_validate.c,v retrieving revision 1.52 retrieving revision 1.55 diff -u -p -r1.52 -r1.55 --- mandoc/mdoc_validate.c 2009/10/31 06:10:58 1.52 +++ mandoc/mdoc_validate.c 2010/01/01 15:14:03 1.55 @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.52 2009/10/31 06:10:58 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.55 2010/01/01 15:14:03 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -194,7 +194,7 @@ const struct valids mdoc_valids[MDOC_MAX] = { { NULL, posts_xr }, /* Xr */ { NULL, posts_text }, /* %A */ { NULL, posts_text }, /* %B */ /* FIXME: can be used outside Rs/Re. */ - { NULL, posts_text }, /* %D */ + { NULL, posts_text }, /* %D */ /* FIXME: check date with mandoc_a2time(). */ { NULL, posts_text }, /* %I */ { NULL, posts_text }, /* %J */ { NULL, posts_text }, /* %N */ @@ -665,6 +665,8 @@ pre_bl(PRE_ARGS) /* FALLTHROUGH */ case (MDOC_Diag): /* FALLTHROUGH */ + case (MDOC_Ohang): + /* FALLTHROUGH */ case (MDOC_Inset): /* FALLTHROUGH */ case (MDOC_Item): @@ -806,6 +808,8 @@ static int pre_dt(PRE_ARGS) { + /* FIXME: make sure is capitalised. */ + if (0 == mdoc->meta.date || mdoc->meta.os) if ( ! mdoc_nwarn(mdoc, n, EPROLOOO)) return(0); @@ -1082,11 +1086,18 @@ post_bl(POST_ARGS) if (NULL == mdoc->last->child) return(1); + /* + * We only allow certain children of `Bl'. This is usually on + * `It', but apparently `Sm' occurs here and there, so we let + * that one through, too. + */ + /* LINTED */ for (n = mdoc->last->child; n; n = n->next) { - if (MDOC_BLOCK == n->type) - if (MDOC_It == n->tok) - continue; + if (MDOC_BLOCK == n->type && MDOC_It == n->tok) + continue; + if (MDOC_Sm == n->tok) + continue; return(mdoc_nerr(mdoc, n, EBADCHILD)); }