source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: During validation, drop .br before a text line starting with a
@ 2018-12-04  3:29 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-12-04  3:29 UTC (permalink / raw)
  To: source

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

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

only message in thread, other threads:[~2018-12-04  3:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04  3:29 mandoc: During validation, drop .br before a text line starting with a 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).