=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.13 retrieving revision 1.15 diff -u -p -r1.13 -r1.15 --- mandoc/mdoc_term.c 2009/06/15 20:26:47 1.13 +++ mandoc/mdoc_term.c 2009/06/17 18:42:42 1.15 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.13 2009/06/15 20:26:47 kristaps Exp $ */ +/* $Id: mdoc_term.c,v 1.15 2009/06/17 18:42:42 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -183,7 +183,7 @@ struct termact { }; static const struct termact termacts[MDOC_MAX] = { - { NULL, NULL }, /* \" */ + { termp_ap_pre, NULL }, /* Ap */ { NULL, NULL }, /* Dd */ { NULL, NULL }, /* Dt */ { NULL, NULL }, /* Os */ @@ -290,8 +290,7 @@ static const struct termact termacts[MDOC_MAX] = { { NULL, NULL }, /* Fr */ { termp_ud_pre, NULL }, /* Ud */ { termp_lb_pre, termp_lb_post }, /* Lb */ - { termp_ap_pre, NULL }, /* Lb */ - { termp_pp_pre, NULL }, /* Pp */ + { termp_pp_pre, NULL }, /* Lp */ { termp_lk_pre, NULL }, /* Lk */ { termp_mt_pre, NULL }, /* Mt */ { termp_brq_pre, termp_brq_post }, /* Brq */ @@ -336,7 +335,10 @@ mdoc_run(struct termp *p, const struct mdoc *m) */ print_head(p, mdoc_meta(m)); - print_body(p, NULL, mdoc_meta(m), mdoc_node(m)); + assert(mdoc_node(m)); + assert(MDOC_ROOT == mdoc_node(m)->type); + if (mdoc_node(m)->child) + print_body(p, NULL, mdoc_meta(m), mdoc_node(m)->child); print_foot(p, mdoc_meta(m)); return(1); } @@ -712,7 +714,7 @@ termp_it_pre(DECL_ARGS) { const struct mdoc_node *bl, *n; char buf[7]; - int i, type, keys[3], vals[3]; + int i, type, keys[3], vals[3], sv; size_t width, offset; if (MDOC_BLOCK == node->type) @@ -896,17 +898,20 @@ termp_it_pre(DECL_ARGS) /* * The dash, hyphen, bullet and enum lists all have a special - * HEAD character. Print it now. + * HEAD character (temporarily bold, in some cases). */ + sv = p->flags; if (MDOC_HEAD == node->type) switch (type) { case (MDOC_Bullet): + p->flags |= TERMP_BOLD; term_word(p, "\\[bu]"); break; case (MDOC_Dash): /* FALLTHROUGH */ case (MDOC_Hyphen): + p->flags |= TERMP_BOLD; term_word(p, "\\-"); break; case (MDOC_Enum): @@ -918,6 +923,8 @@ termp_it_pre(DECL_ARGS) default: break; } + + p->flags = sv; /* Restore saved flags. */ /* * If we're not going to process our children, indicate so here.