summaryrefslogtreecommitdiffstats
path: root/man_html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-12 10:43:22 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-12 10:43:22 +0000
commit2bf82dba54d0ddc4e85c60a1627506ced02908f0 (patch)
treea82dabc3e5509d2cd4a383b5799e38c3a7615bbd /man_html.c
parentd184f91df1cea2fba0dbd3f880de0a6e9f7b84ac (diff)
downloadmandoc-2bf82dba54d0ddc4e85c60a1627506ced02908f0.tar.gz
If the first character of free-form text is whitespace, then a newline
shall precede outputted text (surprise!).
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/man_html.c b/man_html.c
index 2495c8cd..4217e87e 100644
--- a/man_html.c
+++ b/man_html.c
@@ -197,7 +197,16 @@ print_man_node(MAN_ARGS)
child = man_root_pre(m, n, mh, h);
break;
case (MAN_TEXT):
+ if ('\0' == *n->string) {
+ print_otag(h, TAG_P, 0, NULL);
+ return;
+ }
+
+ if (' ' == *n->string && MAN_LINE & n->flags)
+ print_otag(h, TAG_BR, 0, NULL);
+
print_text(h, n->string);
+
if (MANH_LITERAL & mh->fl)
print_otag(h, TAG_BR, 0, NULL);
return;