=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.115 retrieving revision 1.117 diff -u -p -r1.115 -r1.117 --- mandoc/mdoc_man.c 2017/05/08 15:34:54 1.115 +++ mandoc/mdoc_man.c 2017/06/04 22:44:15 1.117 @@ -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.117 2017/06/04 22:44:15 schwarze Exp $ */ /* * Copyright (c) 2011-2017 Ingo Schwarze * @@ -128,6 +128,7 @@ static const void_fp roff_manacts[ROFF_MAX] = { pre_br, pre_ft, pre_onearg, + pre_onearg, pre_sp, pre_ta, pre_onearg, @@ -1527,16 +1528,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 +1563,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);