source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: During validation, drop .br before a text line starting with a
Date: Mon, 3 Dec 2018 22:29:28 -0500 (EST)	[thread overview]
Message-ID: <381db3b4e1a6da36@fantadrom.bsd.lv> (raw)

Log Message:
-----------
During validation, drop .br before a text line starting with a 
blank, rather than teaching each formatter individually to ignore
the .br in such situations.  That's simpler and also results in
better diagnostics.

Mark Harris <mark dot hsj at gmail dot com> reported 
that -T html got confused in particular.

Modified Files:
--------------
    mandoc:
        roff_validate.c

Revision Data
-------------
Index: roff_validate.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_validate.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lroff_validate.c -Lroff_validate.c -u -p -r1.11 -r1.12
--- roff_validate.c
+++ roff_validate.c
@@ -67,6 +67,14 @@ roff_valid_br(ROFF_VALID_ARGS)
 		mandoc_vmsg(MANDOCERR_ARG_SKIP, man->parse,
 		    n->line, n->pos, "br %s", n->child->string);
 
+	if (n->next != NULL && n->next->type == ROFFT_TEXT &&
+	    *n->next->string == ' ') {
+		mandoc_msg(MANDOCERR_PAR_SKIP, man->parse, n->line, n->pos,
+		    "br before text line with leading blank");
+		roff_node_delete(man, n);
+		return;
+	}
+
 	if ((np = n->prev) == NULL)
 		return;
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2018-12-04  3:29 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=381db3b4e1a6da36@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).