From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2069 invoked from network); 16 Oct 2020 17:23:29 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 16 Oct 2020 17:23:29 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id b15cc133 for ; Fri, 16 Oct 2020 12:23:25 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 1e60efd8 for ; Fri, 16 Oct 2020 12:23:25 -0500 (EST) Date: Fri, 16 Oct 2020 12:23:25 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: In HTML output, avoid printing a newline right after
 and 
X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/
Content-Type: text/plain; charset=utf-8
Message-ID: 

Log Message:
-----------
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@. Modified Files: -------------- mandoc: html.c man_html.c mdoc_html.c mandoc/regress/man/HP: literal.out_html mandoc/regress/man/IP: literal.out_html mandoc/regress/man/RS: literal.out_html mandoc/regress/man/SY: literal.out_html mandoc/regress/man/TP: literal.out_html mandoc/regress/mdoc/Bd: nf.out_html paragraph.out_html mandoc/regress/mdoc/Rs: paragraph.out_html mandoc/regress/roff/sp: fill-man.out_html mandoc/regress/roff/string: dotT.out_html Revision Data ------------- Index: paragraph.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Rs/paragraph.out_html,v retrieving revision 1.4 retrieving revision 1.5 diff -Lregress/mdoc/Rs/paragraph.out_html -Lregress/mdoc/Rs/paragraph.out_html -u -p -r1.4 -r1.5 --- regress/mdoc/Rs/paragraph.out_html +++ regress/mdoc/Rs/paragraph.out_html @@ -13,4 +13,3 @@

in a paragraph:

another author, another book.

-
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_html.c,v
retrieving revision 1.340
retrieving revision 1.341
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.340 -r1.341
--- mdoc_html.c
+++ 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;
Index: man_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_html.c,v
retrieving revision 1.178
retrieving revision 1.179
diff -Lman_html.c -Lman_html.c -u -p -r1.178 -r1.179
--- man_html.c
+++ 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
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.270
retrieving revision 1.271
diff -Lhtml.c -Lhtml.c -u -p -r1.270 -r1.271
--- html.c
+++ html.c
@@ -81,7 +81,7 @@ static	const struct htmldata htmltags[TA
 	{"h1",		HTML_TOPHRASE | HTML_NLAROUND},
 	{"h2",		HTML_TOPHRASE | HTML_NLAROUND},
 	{"p",		HTML_TOPHRASE | HTML_NLAROUND | HTML_INDENT},
-	{"pre",		HTML_TOPHRASE | HTML_NLALL | HTML_NOINDENT},
+	{"pre",		HTML_TOPHRASE | HTML_NLAROUND | HTML_NOINDENT},
 	{"a",		HTML_INPHRASE | HTML_TOPHRASE},
 	{"b",		HTML_INPHRASE | HTML_TOPHRASE},
 	{"cite",	HTML_INPHRASE | HTML_TOPHRASE},
Index: literal.out_html
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/HP/literal.out_html,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/man/HP/literal.out_html -Lregress/man/HP/literal.out_html -u -p -r1.2 -r1.3
--- regress/man/HP/literal.out_html
+++ regress/man/HP/literal.out_html
@@ -1,18 +1,12 @@
 

tag indented text

regular paragraph

-
-literal
-text
-
-
-tag
+
literal
+text
+
tag
 literal
 hanged
-paragraph
-
-
-literal
-paragraph
-
+paragraph
+
literal
+paragraph
regular text
Index: literal.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/man/IP/literal.out_html,v retrieving revision 1.6 retrieving revision 1.7 diff -Lregress/man/IP/literal.out_html -Lregress/man/IP/literal.out_html -u -p -r1.6 -r1.7 --- regress/man/IP/literal.out_html +++ regress/man/IP/literal.out_html @@ -3,42 +3,32 @@
indented regular text

new regular paragraph

-
-literal
-text
-
+
literal
+text
-
-indented
+    
indented
 literal
-text
-    
+text
-
-new
+
new
 literal
-paragraph
-
+paragraph
regular text

regular text

-
-literal
-text
-
+
literal
+text
-
-indented
+    
indented
 literal
-text
-    
+text
indented regular text

new regular paragraph

@@ -50,17 +40,13 @@ text
indented regular text -
-indented
+    
indented
 literal
-text
-    
+text
-
-new
+
new
 literal
-paragraph
-
+paragraph
regular text
Index: literal.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/man/RS/literal.out_html,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/man/RS/literal.out_html -Lregress/man/RS/literal.out_html -u -p -r1.2 -r1.3 --- regress/man/RS/literal.out_html +++ regress/man/RS/literal.out_html @@ -1,18 +1,12 @@
initial regular text

-
-literal text
-before display
-
+
literal text
+before display
-
-This is a short line.
-This is a very long line that would wrap if it weren't in literal context.
-
+
This is a short line.
+This is a very long line that would wrap if it weren't in literal context.
-
-literal text
-after display
-
+
literal text
+after display

final regular text
Index: literal.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/man/SY/literal.out_html,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/man/SY/literal.out_html -Lregress/man/SY/literal.out_html -u -p -r1.3 -r1.4 --- regress/man/SY/literal.out_html +++ regress/man/SY/literal.out_html @@ -7,23 +7,17 @@ middle regular text -

-literal text
-before display
-
+
literal text
+before display
command -
-arguments
-    
+
arguments
-
-literal text
-after display
-
+
literal text
+after display

final regular text
Index: literal.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/man/TP/literal.out_html,v retrieving revision 1.4 retrieving revision 1.5 diff -Lregress/man/TP/literal.out_html -Lregress/man/TP/literal.out_html -u -p -r1.4 -r1.5 --- regress/man/TP/literal.out_html +++ regress/man/TP/literal.out_html @@ -3,23 +3,17 @@

regular indented text

regular paragraph

-
-literal
-text
-
+
literal
+text
-
-indented
+    
indented
 literal
-text
-    
+text
-
-literal
-paragraph
-
+
literal
+paragraph
regular text
Index: paragraph.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Bd/paragraph.out_html,v retrieving revision 1.5 retrieving revision 1.6 diff -Lregress/mdoc/Bd/paragraph.out_html -Lregress/mdoc/Bd/paragraph.out_html -u -p -r1.5 -r1.6 --- regress/mdoc/Bd/paragraph.out_html +++ regress/mdoc/Bd/paragraph.out_html @@ -8,13 +8,11 @@ back to normal

another paragraph

-
- literal
+
 literal
 display
 
  literal
-paragraph
-
+paragraph
again back to normal
Index: nf.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/mdoc/Bd/nf.out_html,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/mdoc/Bd/nf.out_html -Lregress/mdoc/Bd/nf.out_html -u -p -r1.2 -r1.3 --- regress/mdoc/Bd/nf.out_html +++ regress/mdoc/Bd/nf.out_html @@ -1,20 +1,14 @@ -
-after .nf
-request
-
+
after .nf
+request

after .fi request

-
-in unfilled
-block
-
+
in unfilled
+block
after .fi request in unfilled block
after end of unfilled block
in filled block -
-after .nf request
-in filled block
-
+
after .nf request
+in filled block
after end of filled block
Index: fill-man.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/roff/sp/fill-man.out_html,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/roff/sp/fill-man.out_html -Lregress/roff/sp/fill-man.out_html -u -p -r1.2 -r1.3 --- regress/roff/sp/fill-man.out_html +++ regress/roff/sp/fill-man.out_html @@ -1,7 +1,5 @@

switch to no-fill mode:

-
-in no-fill mode:
+
in no-fill mode:
 
 back to
-fill mode:
-
+fill mode:
Index: dotT.out_html =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/roff/string/dotT.out_html,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/roff/string/dotT.out_html -Lregress/roff/string/dotT.out_html -u -p -r1.3 -r1.4 --- regress/roff/string/dotT.out_html +++ regress/roff/string/dotT.out_html @@ -1,3 +1,2 @@

We are using the html device.

The device name can be overridden.

-
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv