From e6ebe29e01dda236ae873eb8841f10bc6640c8d5 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 16 Oct 2020 17:22:43 +0000 Subject: In HTML output, avoid printing a newline right after
 and right
 before 
because that resulted in vertical whitespace not requested by the manual page author. Formatting bug reported by Aman Verma on discuss@. --- man_html.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'man_html.c') diff --git a/man_html.c b/man_html.c index 21a76517..5f715cf0 100644 --- a/man_html.c +++ b/man_html.c @@ -169,7 +169,12 @@ print_man_node(MAN_ARGS) if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT) return; - html_fillmode(h, n->flags & NODE_NOFILL ? ROFF_nf : ROFF_fi); + 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 && + (n->prev == NULL || n->prev->tok != MAN_YS)) + print_endline(h); child = 1; switch (n->type) { @@ -253,13 +258,6 @@ print_man_node(MAN_ARGS) } if (t != NULL) print_stagq(h, t); - - if (n->flags & NODE_NOFILL && n->tok != MAN_YS && - (n->next != NULL && n->next->flags & NODE_LINE)) { - /* In .nf =
, print even empty lines. */
-		h->col++;
-		print_endline(h);
-	}
 }
 
 static void
-- 
cgit