summaryrefslogtreecommitdiffstats
path: root/man_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-10-23 17:18:01 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-10-23 17:18:01 +0000
commit17ea1e514bc955b7553d710ab394b06d10ebf912 (patch)
treeff84f4602d953885bcfaae243e7714f859074abb /man_html.c
parent91b1cb33a43568849992bf87dd152de6f67c92e6 (diff)
downloadmandoc-17ea1e514bc955b7553d710ab394b06d10ebf912.tar.gz
Input lines that are not blank but generate no output,
for example lines containing nothing but "\&", are significant in no-fill mode and can be represented by blank lines inside <pre>. Fixing a bug that Pali dot Rohar at gmail dot com found in pod2man(1) output, for example Email::Address::XS(3p). While here, inside no-fill mode, there is no need to encode totally blank input lines by emulating .PP - just let them through as we are inside <pre> anyway.
Diffstat (limited to 'man_html.c')
-rw-r--r--man_html.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/man_html.c b/man_html.c
index 3c91d068..86ebfd9e 100644
--- a/man_html.c
+++ b/man_html.c
@@ -264,7 +264,7 @@ print_man_node(MAN_ARGS)
n->flags & NODE_LINE && *n->string == ' ' &&
(h->flags & HTML_NONEWLINE) == 0)
print_otag(h, TAG_BR, "");
- if (*n->string != '\0')
+ if (want_fillmode == MAN_nf || *n->string != '\0')
break;
print_paragraph(h);
return;
@@ -338,8 +338,11 @@ print_man_node(MAN_ARGS)
print_stagq(h, t);
if (fillmode(h, 0) == MAN_nf &&
- n->next != NULL && n->next->flags & NODE_LINE)
+ n->next != NULL && n->next->flags & NODE_LINE) {
+ /* In .nf = <pre>, print even empty lines. */
+ h->col++;
print_endline(h);
+ }
}
/*