version 1.288, 2017/05/17 17:54:45 |
version 1.290, 2017/06/19 12:57:08 |
Line 1309 mdoc_pp_pre(MDOC_ARGS) |
|
Line 1309 mdoc_pp_pre(MDOC_ARGS) |
|
static int |
static int |
mdoc_lk_pre(MDOC_ARGS) |
mdoc_lk_pre(MDOC_ARGS) |
{ |
{ |
|
const struct roff_node *link, *descr, *punct; |
struct tag *t; |
struct tag *t; |
|
|
if ((n = n->child) == NULL) |
if ((link = n->child) == NULL) |
return 0; |
return 0; |
|
|
|
/* Find beginning of trailing punctuation. */ |
|
punct = n->last; |
|
while (punct != link && punct->flags & NODE_DELIMC) |
|
punct = punct->prev; |
|
punct = punct->next; |
|
|
/* Link target and link text. */ |
/* Link target and link text. */ |
t = print_otag(h, TAG_A, "cTh", "Lk", n->string); |
descr = link->next; |
if (n->next == NULL || n->next->flags & NODE_DELIMC) |
if (descr == punct) |
print_text(h, n->string); |
descr = link; /* no text */ |
for (n = n->next; n != NULL && !(n->flags & NODE_DELIMC); n = n->next) |
t = print_otag(h, TAG_A, "cTh", "Lk", link->string); |
print_text(h, n->string); |
do { |
|
if (descr->flags & (NODE_DELIMC | NODE_DELIMO)) |
|
h->flags |= HTML_NOSPACE; |
|
print_text(h, descr->string); |
|
descr = descr->next; |
|
} while (descr != punct); |
print_tagq(h, t); |
print_tagq(h, t); |
|
|
/* Trailing punctuation. */ |
/* Trailing punctuation. */ |
while (n != NULL) { |
while (punct != NULL) { |
h->flags |= HTML_NOSPACE; |
h->flags |= HTML_NOSPACE; |
print_text(h, n->string); |
print_text(h, punct->string); |
n = n->next; |
punct = punct->next; |
} |
} |
return 0; |
return 0; |
} |
} |