summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-22 14:05:45 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-22 14:05:45 +0000
commitb6591e91b037a5c71a68512372ea2da15154fe2f (patch)
treec96674dbcfbe48c6ed6f289d9f580bab9dab811f /mdoc_html.c
parentbce51df74cd9c0cb090845736c5e6f8313d4fd6c (diff)
downloadmandoc-b6591e91b037a5c71a68512372ea2da15154fe2f.tar.gz
mandoc-b6591e91b037a5c71a68512372ea2da15154fe2f.tar.zst
mandoc-b6591e91b037a5c71a68512372ea2da15154fe2f.zip
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.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 89949737..9656aced 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.154 2011/03/07 01:35:51 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.155 2011/03/22 14:05:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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 ? "," : ".");
}