=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.180 retrieving revision 1.182 diff -u -p -r1.180 -r1.182 --- mandoc/mdoc_term.c 2010/08/07 17:11:17 1.180 +++ mandoc/mdoc_term.c 2010/08/20 22:51:29 1.182 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.180 2010/08/07 17:11:17 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.182 2010/08/20 22:51:29 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -842,6 +842,8 @@ termp_it_pre(DECL_ARGS) if (MDOC_BODY == n->prev->type) p->flags |= TERMP_NOLPAD; + p->flags |= TERMP_IGNDELIM; + break; case (LIST_diag): if (MDOC_HEAD == n->type) @@ -1000,6 +1002,13 @@ termp_it_post(DECL_ARGS) p->flags &= ~TERMP_TWOSPACE; p->flags &= ~TERMP_NOLPAD; p->flags &= ~TERMP_HANG; + + /* + * TERMP_IGNDELIM is also set by `Pf', but it is safe + * to clear it here because `Pf' cannot contain `It'. + */ + + p->flags &= ~TERMP_IGNDELIM; } @@ -1804,6 +1813,10 @@ static void termp_pf_post(DECL_ARGS) { + /* + * XXX Resetting TERMP_IGNDELIM here is not safe + * because `Pf' can be used inside `Bl -column'. + */ p->flags &= ~TERMP_IGNDELIM; p->flags |= TERMP_NOSPACE; } @@ -2119,23 +2132,25 @@ termp_li_pre(DECL_ARGS) static int termp_lk_pre(DECL_ARGS) { - const struct mdoc_node *nn; + const struct mdoc_node *nn, *sv; term_fontpush(p, TERMFONT_UNDER); - nn = n->child; + nn = sv = n->child; + if (NULL == nn->next) return(1); - term_word(p, nn->string); + for (nn = nn->next; nn; nn = nn->next) + term_word(p, nn->string); + term_fontpop(p); p->flags |= TERMP_NOSPACE; term_word(p, ":"); term_fontpush(p, TERMFONT_BOLD); - for (nn = nn->next; nn; nn = nn->next) - term_word(p, nn->string); + term_word(p, sv->string); term_fontpop(p); return(0);