aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitdec80745ea3f5d059dbf60680136a44f3096b59e (patch)
tree25a82abf3c546b978249031a3bbecc773b944792
parente8c53adcb6405ea27097b4c2b26b557e8a9f6064 (diff)
downloadmandoc-dec80745ea3f5d059dbf60680136a44f3096b59e.tar.gz
mandoc-dec80745ea3f5d059dbf60680136a44f3096b59e.tar.zst
mandoc-dec80745ea3f5d059dbf60680136a44f3096b59e.zip
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.
-rw-r--r--man_html.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/man_html.c b/man_html.c
index 12cf8ea7..d487c6e7 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.156 2018/08/18 02:08:27 schwarze Exp $ */
+/* $Id: man_html.c,v 1.157 2018/10/23 17:18:01 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
+ }
}
/*