X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/4cd5b88b9ab0146c48e737ba2e83f5d7fa273d1d..f79712a542f0e0ad60ca7f59357570d33dca7b24:/mdocterm.c diff --git a/mdocterm.c b/mdocterm.c index 0995da7d..a8a06c12 100644 --- a/mdocterm.c +++ b/mdocterm.c @@ -1,4 +1,4 @@ - /* $Id: mdocterm.c,v 1.7 2009/02/23 15:34:53 kristaps Exp $ */ + /* $Id: mdocterm.c,v 1.10 2009/02/25 12:27:37 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -305,6 +305,10 @@ pescape(struct termp *p, const char *word, size_t *i, size_t len) stringa(p, "<-"); else if ('-' == word[*i] && '>' == word[*i + 1]) stringa(p, "->"); + else if ('l' == word[*i] && 'q' == word[*i + 1]) + chara(p, '\"'); + else if ('r' == word[*i] && 'q' == word[*i + 1]) + chara(p, '\"'); (*i)++; return; @@ -406,28 +410,38 @@ 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; + pair.offset = 0; + pair.flag = 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. */ + if (TERMPAIR_FLAG & pair.type) + p->flags |= pair.flag; + if (dochild && node->child) body(p, meta, node->child); + if (TERMPAIR_FLAG & pair.type) + p->flags &= ~pair.flag; + /* 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. */