source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: In no-fill mode, avoid bogus blank lines in two situations: 1.
@ 2019-01-05 21:55 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-01-05 21:55 UTC (permalink / raw)
  To: source

Log Message:
-----------
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.

Modified Files:
--------------
    mandoc:
        man_html.c
    mandoc/regress/man/SY:
        Makefile

Added Files:
-----------
    mandoc/regress/man/SY:
        literal.out_html

Revision Data
-------------
Index: man_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_html.c,v
retrieving revision 1.164
retrieving revision 1.165
diff -Lman_html.c -Lman_html.c -u -p -r1.164 -r1.165
--- man_html.c
+++ man_html.c
@@ -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 = <pre>, print even empty lines. */
 		h->col++;
 		print_endline(h);
--- /dev/null
+++ regress/man/SY/literal.out_html
@@ -0,0 +1,31 @@
+BEGINTEST
+<br/>
+initial regular text
+<table class="Nm">
+  <tr>
+    <td><code class="Nm" title="Nm">command</code></td>
+    <td><i>arguments</i></td>
+  </tr>
+</table>
+middle regular text
+<pre>
+literal text
+before display
+</pre>
+<table class="Nm">
+  <tr>
+    <td><code class="Nm" title="Nm">command</code></td>
+    <td>
+    <pre>
+<i>arguments</i>
+    </pre>
+    </td>
+  </tr>
+</table>
+<pre>
+literal text
+after display
+</pre>
+final regular text
+<br/>
+ENDTEST
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/SY/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/man/SY/Makefile -Lregress/man/SY/Makefile -u -p -r1.1 -r1.2
--- regress/man/SY/Makefile
+++ 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 <bsd.regress.mk>
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-05 21:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-05 21:55 mandoc: In no-fill mode, avoid bogus blank lines in two situations: 1 schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).