diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2020-10-16 17:22:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2020-10-16 17:22:43 +0000 |
commit | e6ebe29e01dda236ae873eb8841f10bc6640c8d5 (patch) | |
tree | afc871e929a8e1bccec831668c7997844336bf37 /mdoc_html.c | |
parent | 8539c24bce93430b560ca288ae81e8c90993e54b (diff) | |
download | mandoc-e6ebe29e01dda236ae873eb8841f10bc6640c8d5.tar.gz |
In HTML output, avoid printing a newline right after <pre>
and right before </pre> because that resulted in vertical
whitespace not requested by the manual page author.
Formatting bug reported by
Aman Verma <amanraoverma plus vim at gmail dot com> on discuss@.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index 5b7bfc85..f698bc27 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -349,12 +349,11 @@ print_mdoc_node(MDOC_ARGS) if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; - if (n->flags & NODE_NOFILL) { - html_fillmode(h, ROFF_nf); - if (n->flags & NODE_LINE) - print_endline(h); - } else + if ((n->flags & NODE_NOFILL) == 0) html_fillmode(h, ROFF_fi); + else if (html_fillmode(h, ROFF_nf) == ROFF_nf && + n->tok != ROFF_fi && n->flags & NODE_LINE) + print_endline(h); child = 1; n->flags &= ~NODE_ENDED; |