X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/b85deb01cef03da6ed5386c5a24881bbba2216b2..f7e2f01b2993cc63491f8e56d3db6f1df3be8bb9:/mdoc_html.c?ds=sidebyside diff --git a/mdoc_html.c b/mdoc_html.c index 5cbf68aa..f2d97f3e 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.291 2017/06/24 14:38:32 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -27,6 +27,7 @@ #include #include "mandoc_aux.h" +#include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "out.h" @@ -1322,12 +1323,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. */