source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: In no-fill mode, avoid bogus blank lines in two situations: 1.
Date: Sat, 5 Jan 2019 16:55:14 -0500 (EST)	[thread overview]
Message-ID: <05f9b1bf8dc221e1@fantadrom.bsd.lv> (raw)

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

                 reply	other threads:[~2019-01-05 21:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05f9b1bf8dc221e1@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).