source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Fix a regression in the previous revision: When there is no link
@ 2017-06-19 12:57 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-06-19 12:57 UTC (permalink / raw)
  To: source

Log Message:
-----------
Fix a regression in the previous revision:
When there is no link description, reuse the URI.
Reported by tj@ and bentley@.

Modified Files:
--------------
    mdocml:
        mdoc_html.c

Revision Data
-------------
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v
retrieving revision 1.289
retrieving revision 1.290
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.289 -r1.290
--- mdoc_html.c
+++ 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. */
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-19 12:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 12:57 mdocml: Fix a regression in the previous revision: When there is no link schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).