diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-10-23 17:17:55 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-10-23 17:17:55 +0000 |
commit | c8096d374cfdc6230fefe96a87324cb6bd599cf8 (patch) | |
tree | 80a18bc7a58a7005272a12e32396e561a6c30bd8 /usr.bin/mandoc/man_html.c | |
parent | b96d3e5a120f3692bb0566f3e6416505fd78c475 (diff) |
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 'usr.bin/mandoc/man_html.c')
-rw-r--r-- | usr.bin/mandoc/man_html.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index a0ef1f75a51..f23a0bd6f89 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_html.c,v 1.109 2018/08/18 02:03:41 schwarze Exp $ */ +/* $OpenBSD: man_html.c,v 1.110 2018/10/23 17:17:54 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org> @@ -262,7 +262,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; @@ -336,8 +336,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); + } } /* |