version 1.7, 2009/02/23 15:34:53 |
version 1.9, 2009/02/25 12:09:20 |
Line 305 pescape(struct termp *p, const char *word, size_t *i, |
|
Line 305 pescape(struct termp *p, const char *word, size_t *i, |
|
stringa(p, "<-"); |
stringa(p, "<-"); |
else if ('-' == word[*i] && '>' == word[*i + 1]) |
else if ('-' == word[*i] && '>' == word[*i + 1]) |
stringa(p, "->"); |
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)++; |
(*i)++; |
return; |
return; |
Line 406 body(struct termp *p, const struct mdoc_meta *meta, |
|
Line 410 body(struct termp *p, const struct mdoc_meta *meta, |
|
const struct mdoc_node *node) |
const struct mdoc_node *node) |
{ |
{ |
int dochild; |
int dochild; |
|
struct termpair pair; |
|
|
/* Pre-processing. */ |
/* Pre-processing. */ |
|
|
dochild = 1; |
dochild = 1; |
|
pair.type = 0; |
|
|
if (MDOC_TEXT != node->type) { |
if (MDOC_TEXT != node->type) { |
if (termacts[node->tok].pre) |
if (termacts[node->tok].pre) |
if ( ! (*termacts[node->tok].pre)(p, meta, node)) |
if ( ! (*termacts[node->tok].pre)(p, &pair, meta, node)) |
dochild = 0; |
dochild = 0; |
} else /* MDOC_TEXT == node->type */ |
} else /* MDOC_TEXT == node->type */ |
word(p, node->data.text.string); |
word(p, node->data.text.string); |
|
|
/* Children. */ |
/* Children. */ |
|
|
|
switch (pair.type) { |
|
case (TERMPAIR_FLAG): |
|
p->flags |= pair.data.flag; |
|
break; |
|
default: |
|
break; |
|
} |
|
|
if (dochild && node->child) |
if (dochild && node->child) |
body(p, meta, node->child); |
body(p, meta, node->child); |
|
|
|
switch (pair.type) { |
|
case (TERMPAIR_FLAG): |
|
p->flags &= ~pair.data.flag; |
|
break; |
|
default: |
|
break; |
|
} |
|
|
/* Post-processing. */ |
/* Post-processing. */ |
|
|
if (MDOC_TEXT != node->type) |
if (MDOC_TEXT != node->type) |
if (termacts[node->tok].post) |
if (termacts[node->tok].post) |
(*termacts[node->tok].post)(p, meta, node); |
(*termacts[node->tok].post)(p, &pair, meta, node); |
|
|
/* Siblings. */ |
/* Siblings. */ |
|
|