=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.159 retrieving revision 1.161 diff -u -p -r1.159 -r1.161 --- mandoc/mdoc_term.c 2010/06/27 01:26:20 1.159 +++ mandoc/mdoc_term.c 2010/06/27 17:53:27 1.161 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.159 2010/06/27 01:26:20 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.161 2010/06/27 17:53:27 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -1278,7 +1278,7 @@ synopsis_pre(struct termp *p, const struct mdoc_node * * Obviously, if we're not in a SYNOPSIS or no prior macros * exist, do nothing. */ - if (NULL == n->prev || SEC_SYNOPSIS != n->sec) + if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags)) return; /* @@ -1543,7 +1543,7 @@ termp_fn_pre(DECL_ARGS) term_word(p, ")"); - if (SEC_SYNOPSIS == n->sec) + if (MDOC_SYNPRETTY & n->flags) term_word(p, ";"); return(0); @@ -1820,7 +1820,7 @@ termp_in_pre(DECL_ARGS) synopsis_pre(p, n); - if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags) { + if (MDOC_SYNPRETTY & n->flags && MDOC_LINE & n->flags) { term_fontpush(p, TERMFONT_BOLD); term_word(p, "#include"); term_word(p, "<"); @@ -1839,13 +1839,13 @@ static void termp_in_post(DECL_ARGS) { - if (SEC_SYNOPSIS == n->sec) + if (MDOC_SYNPRETTY & n->flags) term_fontpush(p, TERMFONT_BOLD); p->flags |= TERMP_NOSPACE; term_word(p, ">"); - if (SEC_SYNOPSIS == n->sec) + if (MDOC_SYNPRETTY & n->flags) term_fontpop(p); } @@ -1987,7 +1987,7 @@ termp_fo_post(DECL_ARGS) p->flags |= TERMP_NOSPACE; term_word(p, ")"); - if (SEC_SYNOPSIS == n->sec) { + if (MDOC_SYNPRETTY & n->flags) { p->flags |= TERMP_NOSPACE; term_word(p, ";"); } @@ -2109,8 +2109,17 @@ static int termp_bk_pre(DECL_ARGS) { - p->flags |= TERMP_PREKEEP; - return(1); + switch (n->type) { + case (MDOC_BLOCK): + return(1); + case (MDOC_HEAD): + return(0); + case (MDOC_BODY): + p->flags |= TERMP_PREKEEP; + return(1); + default: + abort(); + } } @@ -2119,7 +2128,8 @@ static void termp_bk_post(DECL_ARGS) { - p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); + if (MDOC_BODY == n->type) + p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP); } /* ARGSUSED */