diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-30 19:04:16 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-10-30 19:04:16 +0000 |
commit | f09689841f25650e61f65b87c1c8e4c2edbf4137 (patch) | |
tree | 40964ab4cd685543670d3bbbaf51c1461a1d145e /mdoc_validate.c | |
parent | bd1ba68e6adefe4522546f09c18b0e8f7e0326ab (diff) | |
download | mandoc-f09689841f25650e61f65b87c1c8e4c2edbf4137.tar.gz |
If a .Bd block has no arguments at all, drop the block and only keep
its contents. Removing a gratuitious difference to groff output
found after a related bug report from krw@.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 37b3a0f3..5a3a347e 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -895,6 +895,16 @@ post_display(POST_ARGS) break; case ROFFT_BLOCK: if (n->tok == MDOC_Bd) { + if (n->args == NULL) { + mandoc_msg(MANDOCERR_BD_NOARG, + mdoc->parse, n->line, n->pos, "Bd"); + mdoc->next = ROFF_NEXT_SIBLING; + while (n->body->child != NULL) + mdoc_node_relink(mdoc, + n->body->child); + roff_node_delete(mdoc, n); + break; + } post_bd(mdoc); post_prevpar(mdoc); } |