diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-19 12:57:08 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-06-19 12:57:08 +0000 |
commit | 46db02ef58ca19b8830da5e1d120db9546685a3b (patch) | |
tree | 0ae74a3a461810879088a2cc1cb3c529cd508aa9 /mdoc_html.c | |
parent | 6d2d7fe29d2b59f3f7317704a120c6cf8e794ec4 (diff) | |
download | mandoc-46db02ef58ca19b8830da5e1d120db9546685a3b.tar.gz |
Fix a regression in the previous revision:
When there is no link description, reuse the URI.
Reported by tj@ and bentley@.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r-- | mdoc_html.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mdoc_html.c b/mdoc_html.c index bc3a9f06..5e08ab85 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1322,12 +1322,16 @@ mdoc_lk_pre(MDOC_ARGS) punct = punct->next; /* Link target and link text. */ + descr = link->next; + if (descr == punct) + descr = link; /* no text */ t = print_otag(h, TAG_A, "cTh", "Lk", link->string); - for (descr = link->next; descr != punct; descr = descr->next) { + 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); /* Trailing punctuation. */ |