diff options
author | 2017-06-19 12:53:50 +0000 | |
---|---|---|
committer | 2017-06-19 12:53:50 +0000 | |
commit | fd01a48e871d5f9e009ee0585ad5e5837dfc9d8c (patch) | |
tree | e0e158ac740a8ca3290d8fe77e59c73c5a98269a /usr.bin/mandoc/mdoc_html.c | |
parent | Add a handler for the WSDISPLAYIO_GINFO ioctl in radeondrm, allowing (diff) | |
download | wireguard-openbsd-fd01a48e871d5f9e009ee0585ad5e5837dfc9d8c.tar.xz wireguard-openbsd-fd01a48e871d5f9e009ee0585ad5e5837dfc9d8c.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 'usr.bin/mandoc/mdoc_html.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_html.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 1fb8236c273..ec6d155311f 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.164 2017/05/30 16:31:25 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.165 2017/06/19 12:53:50 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -1320,12 +1320,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. */ |