-/* $Id: mdoc_term.c,v 1.204 2010/12/25 23:25:53 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.207 2011/01/02 12:21:07 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
memset(&npair, 0, sizeof(struct termpair));
npair.ppair = pair;
-
- if (MDOC_TEXT == n->type)
- term_word(p, n->string);
- else if (termacts[n->tok].pre && ENDBODY_NOT == n->end)
- chld = (*termacts[n->tok].pre)(p, &npair, m, n);
+
+ switch (n->type) {
+ case (MDOC_TEXT):
+ term_word(p, n->string);
+ break;
+ case (MDOC_TBL):
+ term_tbl(p, n->span);
+ break;
+ default:
+ if (termacts[n->tok].pre && ENDBODY_NOT == n->end)
+ chld = (*termacts[n->tok].pre)
+ (p, &npair, m, n);
+ break;
+ }
/*
* Keeps only work until the end of a line. If a keep was
term_fontpopq(p, font);
- if (MDOC_TEXT != n->type && termacts[n->tok].post &&
- ! (MDOC_ENDED & n->flags)) {
+ switch (n->type) {
+ case (MDOC_TEXT):
+ break;
+ case (MDOC_TBL):
+ break;
+ default:
+ if ( ! termacts[n->tok].post || MDOC_ENDED & n->flags)
+ break;
(void)(*termacts[n->tok].post)(p, &npair, m, n);
/*
*/
if (ENDBODY_NOSPACE == n->end)
p->flags |= TERMP_NOSPACE;
+ break;
}
if (MDOC_EOS & n->flags)
case (MDOC_Bq):
term_word(p, "[");
break;
- case (MDOC__T):
- /* FALLTHROUGH */
case (MDOC_Do):
/* FALLTHROUGH */
case (MDOC_Dq):
case (MDOC_Pq):
term_word(p, "(");
break;
+ case (MDOC__T):
+ /* FALLTHROUGH */
case (MDOC_Qo):
/* FALLTHROUGH */
case (MDOC_Qq):
case (MDOC_Bq):
term_word(p, "]");
break;
- case (MDOC__T):
- /* FALLTHROUGH */
case (MDOC_Do):
/* FALLTHROUGH */
case (MDOC_Dq):
case (MDOC_Pq):
term_word(p, ")");
break;
+ case (MDOC__T):
+ /* FALLTHROUGH */
case (MDOC_Qo):
/* FALLTHROUGH */
case (MDOC_Qq):