From f8052141c250afadccc7fd035952e2730d17af8b Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 19 Jun 2017 12:57:08 +0000 Subject: Fix a regression in the previous revision: When there is no link description, reuse the URI. Reported by tj@ and bentley@. --- mdoc_html.c | 10 +++++++--- 1 file 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 * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -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. */ -- cgit v1.2.3-56-ge451