diff options
Diffstat (limited to 'mdoc_macro.c')
-rw-r--r-- | mdoc_macro.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mdoc_macro.c b/mdoc_macro.c index 3e27c1e7..8624ea98 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1321,10 +1321,21 @@ blk_part_imp(MACRO_PROT_ARGS) } } assert(n == body); - rew_sub(MDOC_BODY, mdoc, tok, line, ppos); + rew_last(mdoc, body); if (nl) append_delims(mdoc, line, pos, buf); - rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos); + rew_last(mdoc, blk); + + /* + * The current block extends an enclosing block. + * Now that the current block ends, close the enclosing block, too. + */ + + while ((blk = blk->pending) != NULL) { + rew_last(mdoc, blk); + if (blk->type == MDOC_HEAD) + mdoc_body_alloc(mdoc, blk->line, blk->pos, blk->tok); + } /* Move trailing .Ns out of scope. */ |