- /*
- * If the inner breaker (A) is already broken, too,
- * it cannot take on the outer breaker (X) but must
- * hand it on to its own breakers (Y). Graphically,
- *
- * [X! n=[Y!->X breaker=[A!->Y Y] broken=[B(->X)->A X] A] B]
- */
-
- while (n->pending)
- n = n->pending;
- n->pending = broken->pending;
+ irc = 0;
+ for (n = mdoc->last; n != NULL && n != target; n = n->parent) {
+ if (n->flags & NODE_ENDED)
+ continue;
+ if (n->type == ROFFT_BLOCK &&
+ mdoc_macros[n->tok].flags & MDOC_EXPLICIT) {
+ irc = 1;
+ break_intermediate(mdoc->last, target);
+ if (target->type == ROFFT_HEAD)
+ target->flags |= NODE_ENDED;
+ else if ( ! (target->flags & NODE_ENDED)) {
+ mandoc_vmsg(MANDOCERR_BLK_NEST,
+ mdoc->parse, line, ppos,
+ "%s breaks %s", mdoc_macronames[tok],
+ mdoc_macronames[n->tok]);
+ mdoc_endbody_alloc(mdoc, line, ppos,
+ tok, target);
+ }
+ }