summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdoc_term.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 8e921d44..ad2b3ab3 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -319,9 +319,12 @@ print_mdoc_node(DECL_ARGS)
/*
* Keeps only work until the end of a line. If a keep was
* invoked in a prior line, revert it to PREKEEP.
+ *
+ * Also let SYNPRETTY sections behave as if they were wrapped
+ * in a `Bk' block.
*/
- if (TERMP_KEEP & p->flags) {
+ if (TERMP_KEEP & p->flags || MDOC_SYNPRETTY & n->flags) {
if (n->prev && n->prev->line != n->line) {
p->flags &= ~TERMP_KEEP;
p->flags |= TERMP_PREKEEP;
@@ -333,6 +336,16 @@ print_mdoc_node(DECL_ARGS)
}
}
+ /*
+ * Since SYNPRETTY sections aren't "turned off" with `Ek',
+ * we have to intuit whether we should disable formatting.
+ */
+
+ if ( ! (MDOC_SYNPRETTY & n->flags) &&
+ ((n->prev && MDOC_SYNPRETTY & n->prev->flags) ||
+ (n->parent && MDOC_SYNPRETTY & n->parent->flags)))
+ p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);
+
if (chld && n->child)
print_mdoc_nodelist(p, &npair, m, n->child);