=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.115 retrieving revision 1.118 diff -u -p -r1.115 -r1.118 --- mandoc/mdoc_man.c 2017/05/08 15:34:54 1.115 +++ mandoc/mdoc_man.c 2017/06/06 15:01:04 1.118 @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.115 2017/05/08 15:34:54 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.118 2017/06/06 15:01:04 schwarze Exp $ */ /* * Copyright (c) 2011-2017 Ingo Schwarze * @@ -126,8 +126,10 @@ static void print_node(DECL_ARGS); static const void_fp roff_manacts[ROFF_MAX] = { pre_br, + pre_onearg, pre_ft, pre_onearg, + pre_onearg, pre_sp, pre_ta, pre_onearg, @@ -1527,16 +1529,22 @@ post_lb(DECL_ARGS) static int pre_lk(DECL_ARGS) { - const struct roff_node *link, *descr; + const struct roff_node *link, *descr, *punct; int display; if ((link = n->child) == NULL) return 0; + /* Find beginning of trailing punctuation. */ + punct = n->last; + while (punct != link && punct->flags & NODE_DELIMC) + punct = punct->prev; + punct = punct->next; + /* Link text. */ - if ((descr = link->next) != NULL && !(descr->flags & NODE_DELIMC)) { + if ((descr = link->next) != NULL && descr != punct) { font_push('I'); - while (descr != NULL && !(descr->flags & NODE_DELIMC)) { + while (descr != punct) { print_word(descr->string); descr = descr->next; } @@ -1556,9 +1564,9 @@ pre_lk(DECL_ARGS) font_pop(); /* Trailing punctuation. */ - while (descr != NULL) { - print_word(descr->string); - descr = descr->next; + while (punct != NULL) { + print_word(punct->string); + punct = punct->next; } if (display) print_line(".RE", MMAN_nl); @@ -1575,6 +1583,9 @@ pre_onearg(DECL_ARGS) if (n->child != NULL) print_word(n->child->string); outflags |= MMAN_nl; + if (n->tok == ROFF_ce) + for (n = n->child->next; n != NULL; n = n->next) + print_node(meta, n); } static int