aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--roff_validate.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/roff_validate.c b/roff_validate.c
index 3e301c05..222f2339 100644
--- a/roff_validate.c
+++ b/roff_validate.c
@@ -1,4 +1,4 @@
-/* $Id: roff_validate.c,v 1.11 2018/12/04 02:53:51 schwarze Exp $ */
+/* $Id: roff_validate.c,v 1.12 2018/12/04 03:28:58 schwarze Exp $ */
/*
* Copyright (c) 2010, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -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;