=================================================================== RCS file: /cvs/mandoc/mdoc_term.c,v retrieving revision 1.322 retrieving revision 1.327 diff -u -p -r1.322 -r1.327 --- mandoc/mdoc_term.c 2015/07/25 14:18:04 1.322 +++ mandoc/mdoc_term.c 2015/09/26 00:54:04 1.327 @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.322 2015/07/25 14:18:04 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.327 2015/09/26 00:54:04 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze @@ -95,6 +95,7 @@ static int termp_bx_pre(DECL_ARGS); static int termp_cd_pre(DECL_ARGS); static int termp_d1_pre(DECL_ARGS); static int termp_eo_pre(DECL_ARGS); +static int termp_er_pre(DECL_ARGS); static int termp_ex_pre(DECL_ARGS); static int termp_fa_pre(DECL_ARGS); static int termp_fd_pre(DECL_ARGS); @@ -145,8 +146,8 @@ static const struct termact termacts[MDOC_MAX] = { { termp_under_pre, NULL }, /* Ar */ { termp_cd_pre, NULL }, /* Cd */ { termp_bold_pre, NULL }, /* Cm */ - { NULL, NULL }, /* Dv */ - { NULL, NULL }, /* Er */ + { termp_li_pre, NULL }, /* Dv */ + { termp_er_pre, NULL }, /* Er */ { termp_tag_pre, NULL }, /* Ev */ { termp_ex_pre, NULL }, /* Ex */ { termp_fa_pre, NULL }, /* Fa */ @@ -801,7 +802,7 @@ termp_it_pre(DECL_ARGS) if (n->type != ROFFT_HEAD) break; - p->flags |= TERMP_NOBREAK | TERMP_BRIND; + p->flags |= TERMP_NOBREAK | TERMP_BRTRSP | TERMP_BRIND; p->trailspace = 2; if (NULL == n->next || NULL == n->next->child) @@ -973,7 +974,7 @@ termp_it_post(DECL_ARGS) * has munged them in the meanwhile. */ - p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | + p->flags &= ~(TERMP_NOBREAK | TERMP_BRTRSP | TERMP_BRIND | TERMP_DANGLE | TERMP_HANG); p->trailspace = 0; } @@ -1480,10 +1481,8 @@ termp_fn_pre(DECL_ARGS) term_word(p, n->string); term_fontpop(p); - if (n->sec == SEC_DESCRIPTION) { - if ( ! tag_get(n->string, 0, ++fn_prio)) - tag_put(n->string, 0, fn_prio, p->line); - } + if (n->sec == SEC_DESCRIPTION) + tag_put(n->string, ++fn_prio, p->line); if (pretty) { term_flushln(p); @@ -1722,7 +1721,6 @@ termp_xx_pre(DECL_ARGS) break; default: abort(); - /* NOTREACHED */ } term_word(p, pp); @@ -1919,7 +1917,6 @@ termp_quote_pre(DECL_ARGS) break; default: abort(); - /* NOTREACHED */ } p->flags |= TERMP_NOSPACE; @@ -1990,7 +1987,6 @@ termp_quote_post(DECL_ARGS) break; default: abort(); - /* NOTREACHED */ } } @@ -2219,7 +2215,6 @@ termp_bk_pre(DECL_ARGS) break; default: abort(); - /* NOTREACHED */ } return(1); @@ -2273,6 +2268,18 @@ termp_under_pre(DECL_ARGS) } static int +termp_er_pre(DECL_ARGS) +{ + + if (n->sec == SEC_ERRORS && + (n->parent->tok == MDOC_It || + (n->parent->tok == MDOC_Bq && + n->parent->parent->parent->tok == MDOC_It))) + tag_put(n->child->string, 1, p->line); + return(1); +} + +static int termp_tag_pre(DECL_ARGS) { @@ -2282,8 +2289,7 @@ termp_tag_pre(DECL_ARGS) (n->parent->tok == MDOC_It || (n->parent->tok == MDOC_Xo && n->parent->parent->prev == NULL && - n->parent->parent->parent->tok == MDOC_It)) && - ! tag_get(n->child->string, 0, 1)) - tag_put(n->child->string, 0, 1, p->line); + n->parent->parent->parent->tok == MDOC_It))) + tag_put(n->child->string, 1, p->line); return(1); }