- return(p->end || (MDOC_BLOCK == p->type &&
- ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)) ?
- REWIND_MORE : REWIND_LATER);
+ /*
+ * Default block rewinding rules.
+ * In particular, always skip block end markers,
+ * and let all blocks rewind Nm children.
+ */
+ if (ENDBODY_NOT != p->end || MDOC_Nm == p->tok ||
+ (MDOC_BLOCK == p->type &&
+ ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)))
+ return(REWIND_MORE);
+
+ /*
+ * Partial blocks allow delayed rewinding by default.
+ */
+ if (&blk_full != mdoc_macros[tok].fp)
+ return (REWIND_LATER);
+
+ /*
+ * Full blocks can only be rewound when matching
+ * or when there is an explicit rule.
+ */
+ return(REWIND_ERROR);