summaryrefslogtreecommitdiffstats
path: root/mdocterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdocterm.c')
-rw-r--r--mdocterm.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/mdocterm.c b/mdocterm.c
index d4b27c9e..014a010f 100644
--- a/mdocterm.c
+++ b/mdocterm.c
@@ -410,28 +410,46 @@ body(struct termp *p, const struct mdoc_meta *meta,
const struct mdoc_node *node)
{
int dochild;
+ struct termpair pair;
/* Pre-processing. */
dochild = 1;
+ pair.type = 0;
if (MDOC_TEXT != node->type) {
if (termacts[node->tok].pre)
- if ( ! (*termacts[node->tok].pre)(p, meta, node))
+ if ( ! (*termacts[node->tok].pre)(p, &pair, meta, node))
dochild = 0;
} else /* MDOC_TEXT == node->type */
word(p, node->data.text.string);
/* Children. */
+ switch (pair.type) {
+ case (TERMPAIR_FLAG):
+ p->flags |= pair.data.flag;
+ break;
+ default:
+ break;
+ }
+
if (dochild && node->child)
body(p, meta, node->child);
+ switch (pair.type) {
+ case (TERMPAIR_FLAG):
+ p->flags &= ~pair.data.flag;
+ break;
+ default:
+ break;
+ }
+
/* Post-processing. */
if (MDOC_TEXT != node->type)
if (termacts[node->tok].post)
- (*termacts[node->tok].post)(p, meta, node);
+ (*termacts[node->tok].post)(p, &pair, meta, node);
/* Siblings. */