aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-10-16 17:22:43 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-10-16 17:22:43 +0000
commit7f36e58ef077e2bf3ff4592144b6be7ccc0db8de (patch)
tree6cfddb47fabc9a3aa09e66786d7c5bc244574cd4 /mdoc_html.c
parent9f048bffaf55fe5d4982bd74026e6003754fe978 (diff)
downloadmandoc-7f36e58ef077e2bf3ff4592144b6be7ccc0db8de.tar.gz
mandoc-7f36e58ef077e2bf3ff4592144b6be7ccc0db8de.tar.zst
mandoc-7f36e58ef077e2bf3ff4592144b6be7ccc0db8de.zip
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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index d96df6df..0569255b 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.340 2020/04/19 15:16:56 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.341 2020/10/16 17:22:43 schwarze Exp $ */
/*
* Copyright (c) 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -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;