diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-22 14:05:45 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-03-22 14:05:45 +0000 |
commit | d5822e61b86d3e01e8c8d87feb97cabb4ad9d67d (patch) | |
tree | 439a6c27b466f868e39f65342ef862ecdca567b1 /mdoc_html.c | |
parent | 08cbd42d2a572e1adaf5a6aa56d2837a739274e6 (diff) | |
download | mandoc-d5822e61b86d3e01e8c8d87feb97cabb4ad9d67d.tar.gz |
Move mandoc_isdelim() back into libmdoc.h. This fixes an unreported
error where (1) -man pages were punctuating delimiters (e.g., `.B a ;')
and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its
own line) would also be punctuated. This introduces a small amount of
complexity of mdoc_{html,term}.c must manage their own spacing with
running print_word() or print_text(). The check for delimiting now
happens in mdoc_macro.c's dword().
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 19bf848e..1dc7ecbd 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -431,7 +431,11 @@ print_mdoc_node(MDOC_ARGS) if (' ' == *n->string && MDOC_LINE & n->flags) if ( ! (HTML_LITERAL & h->flags)) print_otag(h, TAG_BR, 0, NULL); + if (MDOC_DELIMC & n->flags) + h->flags |= HTML_NOSPACE; print_text(h, n->string); + if (MDOC_DELIMO & n->flags) + h->flags |= HTML_NOSPACE; return; case (MDOC_EQN): PAIR_CLASS_INIT(&tag, "eqn"); @@ -1381,12 +1385,16 @@ mdoc_fa_pre(MDOC_ARGS) t = print_otag(h, TAG_I, 1, &tag); print_text(h, nn->string); print_tagq(h, t); - if (nn->next) + if (nn->next) { + h->flags |= HTML_NOSPACE; print_text(h, ","); + } } - if (n->child && n->next && n->next->tok == MDOC_Fa) + if (n->child && n->next && n->next->tok == MDOC_Fa) { + h->flags |= HTML_NOSPACE; print_text(h, ","); + } return(0); } @@ -1514,13 +1522,19 @@ mdoc_fn_pre(MDOC_ARGS) t = print_otag(h, TAG_I, i, tag); print_text(h, nn->string); print_tagq(h, t); - if (nn->next) + if (nn->next) { + h->flags |= HTML_NOSPACE; print_text(h, ","); + } } + h->flags |= HTML_NOSPACE; print_text(h, ")"); - if (MDOC_SYNPRETTY & n->flags) + + if (MDOC_SYNPRETTY & n->flags) { + h->flags |= HTML_NOSPACE; print_text(h, ";"); + } return(0); } @@ -1671,7 +1685,9 @@ mdoc_fo_post(MDOC_ARGS) if (MDOC_BODY != n->type) return; + h->flags |= HTML_NOSPACE; print_text(h, ")"); + h->flags |= HTML_NOSPACE; print_text(h, ";"); } @@ -2032,6 +2048,7 @@ mdoc__x_post(MDOC_ARGS) if (NULL == n->parent || MDOC_Rs != n->parent->tok) return; + h->flags |= HTML_NOSPACE; print_text(h, n->next ? "," : "."); } |