- 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);
+ }