diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-17 06:44:58 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-11-17 06:44:58 +0000 |
commit | a95737d0fe7d58cea73235887cdce9f58bae1335 (patch) | |
tree | b1e382b6e729e9db6aff88da6d68fc0cb999f2af /mdoc_validate.c | |
parent | 194fdd32fe2e8d95e8130915d406a4509ac1caf7 (diff) | |
download | mandoc-a95737d0fe7d58cea73235887cdce9f58bae1335.tar.gz mandoc-a95737d0fe7d58cea73235887cdce9f58bae1335.tar.zst mandoc-a95737d0fe7d58cea73235887cdce9f58bae1335.zip |
Multiple fixes with respect to in-line macros:
* .No selects the default font; relevant e.g. in .Bf blocks
* no need to force empty .Li elements
* closing delimiters as leading macro arguments do not suppress space
* opening delimiters at the end of a macro line do not suppress space
* correctly handle delimiter spacing in -Tman
As a side effect, these fixes let mandoc warn about empty .No macros
as requested by bentley@.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index c0ed2621..4b5863ef 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.254 2014/10/30 20:10:02 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.255 2014/11/17 06:44:58 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -209,7 +209,7 @@ static const struct valids mdoc_valids[MDOC_MAX] = { { NULL, NULL }, /* Eo */ { NULL, NULL }, /* Fx */ { NULL, NULL }, /* Ms */ - { NULL, ewarn_eq0 }, /* No */ + { NULL, NULL }, /* No */ { NULL, post_ns }, /* Ns */ { NULL, NULL }, /* Nx */ { NULL, NULL }, /* Ox */ @@ -353,6 +353,20 @@ mdoc_valid_post(struct mdoc *mdoc) case MDOC_ROOT: return(post_root(mdoc)); default: + + /* + * Closing delimiters are not special at the + * beginning of a block, opening delimiters + * are not special at the end. + */ + + if (n->child != NULL) + n->child->flags &= ~MDOC_DELIMC; + if (n->last != NULL) + n->last->flags &= ~MDOC_DELIMO; + + /* Call the macro's postprocessor. */ + p = mdoc_valids[n->tok].post; return(*p ? (*p)(mdoc) : 1); } @@ -1162,10 +1176,6 @@ post_defaults(POST_ARGS) if ( ! mdoc_word_alloc(mdoc, nn->line, nn->pos, "...")) return(0); break; - case MDOC_Li: - if ( ! mdoc_word_alloc(mdoc, nn->line, nn->pos, "")) - return(0); - break; case MDOC_Pa: /* FALLTHROUGH */ case MDOC_Mt: |