-/* $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 <schwarze@openbsd.org>
*
static const void_fp roff_manacts[ROFF_MAX] = {
pre_br,
+ pre_onearg,
pre_ft,
pre_onearg,
+ pre_onearg,
pre_sp,
pre_ta,
pre_onearg,
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;
}
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);
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