From 589d3fbc1807388fbe883742468701520d81c047 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 5 Jan 2019 21:55:11 +0000 Subject: In no-fill mode, avoid bogus blank lines in two situations: 1. After the last child; the parent will take care of the line break. 2. At the .YS macro; the end of the preceding .SY already broke the line. --- man_html.c | 6 +++--- regress/man/SY/Makefile | 3 ++- regress/man/SY/literal.out_html | 31 +++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 regress/man/SY/literal.out_html diff --git a/man_html.c b/man_html.c index 94146052..0eb482b0 100644 --- a/man_html.c +++ b/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.164 2019/01/05 09:46:34 schwarze Exp $ */ +/* $Id: man_html.c,v 1.165 2019/01/05 21:55:11 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2013-2015, 2017-2019 Ingo Schwarze @@ -256,8 +256,8 @@ print_man_node(MAN_ARGS) /* This will automatically close out any font scope. */ print_stagq(h, t); - if (n->flags & NODE_NOFILL && - (n->next == NULL || n->next->flags & NODE_LINE)) { + 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);
diff --git a/regress/man/SY/Makefile b/regress/man/SY/Makefile
index 54045804..9896d9d1 100644
--- a/regress/man/SY/Makefile
+++ b/regress/man/SY/Makefile
@@ -1,5 +1,6 @@
-# $OpenBSD: Makefile,v 1.1 2019/01/05 21:13:55 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2019/01/05 21:52:57 schwarze Exp $
 
 REGRESS_TARGETS	 = literal
+HTML_TARGETS	 = literal
 
 .include 
diff --git a/regress/man/SY/literal.out_html b/regress/man/SY/literal.out_html
new file mode 100644
index 00000000..b1f378cf
--- /dev/null
+++ b/regress/man/SY/literal.out_html
@@ -0,0 +1,31 @@
+BEGINTEST
+
+initial regular text + + + + + +
commandarguments
+middle regular text +
+literal text
+before display
+
+ + + + + +
command +
+arguments
+    
+
+
+literal text
+after display
+
+final regular text +
+ENDTEST -- cgit v1.2.3-56-ge451