aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-19 12:57:08 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-19 12:57:08 +0000
commitf8052141c250afadccc7fd035952e2730d17af8b (patch)
tree07d640156308bdce772d28f4882471ca9a322050 /mdoc_html.c
parent4e3e49e7768b3c4f42921865c4d39b90be193bbd (diff)
downloadmandoc-f8052141c250afadccc7fd035952e2730d17af8b.tar.gz
mandoc-f8052141c250afadccc7fd035952e2730d17af8b.tar.zst
mandoc-f8052141c250afadccc7fd035952e2730d17af8b.zip
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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 5cbf68aa..3234cea0 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.289 2017/05/30 16:31:29 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.290 2017/06/19 12:57:08 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -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. */