- struct mdoc_node *n;
-
- mandoc_vmsg(MANDOCERR_BLK_NEST, mdoc->parse, line, ppos,
- "%s breaks %s", mdoc_macronames[breaker->tok],
- mdoc_macronames[broken->tok]);
-
- /*
- * If the *broken block (Z) is already broken by a block (B)
- * contained in the breaker (A), make the breaker pending
- * on that inner breaker (B). Graphically,
- *
- * breaker=[A! broken=n=[B!->A (old broken=)[Z->B B] A] Z]
- *
- * In these graphics, "->" indicates the "pending" pointer and
- * "!" indicates the MDOC_BREAK flag. Each of the cases gets
- * one additional pointer (B->A) and one additional flag (A!).
- */
-
- for (n = broken->parent; ; n = n->parent)
- if (n == broken->pending)
- broken = n;
- else if (n == breaker)
- break;
+ if (n != breaker &&
+ n->type != ROFFT_BLOCK && n->type != ROFFT_HEAD &&
+ (n->type != ROFFT_BODY || n->end != ENDBODY_NOT))
+ n = n->parent;
+ while (n != breaker) {
+ if ( ! (n->flags & NODE_VALID))
+ n->flags |= NODE_BROKEN;
+ n = n->parent;
+ }
+}