+ mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, n->line,
+ n->pos, "%s breaks %s", man_macronames[tok],
+ man_macronames[n->tok]);
+
+ man_node_delete(man, n);
+ man->flags &= ~MAN_ELINE;
+ }
+
+ /*
+ * Remove prior BLINE macro that is being clobbered.
+ */
+ if ((man->flags & MAN_BLINE) &&
+ (man_macros[tok].flags & MAN_BSCOPE)) {
+ n = man->last;
+
+ /* Might be a text node like 8 in
+ * .TP 8
+ * .SH foo
+ */
+ if (n->type == MAN_TEXT)
+ n = n->parent;
+
+ /* Remove element that didn't end BLINE, if any. */
+ if ( ! (man_macros[n->tok].flags & MAN_BSCOPE))
+ n = n->parent;
+
+ assert(n->type == MAN_HEAD);
+ n = n->parent;
+ assert(n->type == MAN_BLOCK);
+ assert(man_macros[n->tok].flags & MAN_SCOPED);
+
+ mandoc_vmsg(MANDOCERR_BLK_LINE, man->parse, n->line,
+ n->pos, "%s breaks %s", man_macronames[tok],
+ man_macronames[n->tok]);
+
+ man_node_delete(man, n);
+ man->flags &= ~MAN_BLINE;
+ }
+
+ /* Remember whether we are in next-line scope for a block head. */
+
+ bline = man->flags & MAN_BLINE;
+
+ /* Call to handler... */
+
+ assert(man_macros[tok].fp);
+ (*man_macros[tok].fp)(man, tok, ln, ppos, &offs, buf);
+
+ /* In quick mode (for mandocdb), abort after the NAME section. */
+
+ if (man->quick && tok == MAN_SH) {
+ n = man->last;
+ if (n->type == MAN_BODY &&
+ strcmp(n->prev->child->string, "NAME"))
+ return(2);
+ }
+
+ /*
+ * If we are in a next-line scope for a block head,
+ * close it out now and switch to the body,
+ * unless the next-line scope is allowed to continue.
+ */
+
+ if ( ! bline || man->flags & MAN_ELINE ||
+ man_macros[tok].flags & MAN_NSCOPED)
+ return(1);
+
+ assert(man->flags & MAN_BLINE);
+ man->flags &= ~MAN_BLINE;
+
+ man_unscope(man, man->last->parent);
+ man_body_alloc(man, ln, ppos, man->last->tok);
+ return(1);
+}
+
+/*
+ * Unlink a node from its context. If "man" is provided, the last parse
+ * point will also be adjusted accordingly.
+ */
+static void
+man_node_unlink(struct man *man, struct man_node *n)