- /* $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 <kristaps@kth.se>
*
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;
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. */