From fcd488027f8d6316b641cffa970d451df8a92c76 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 18 Apr 2020 20:40:10 +0000 Subject: When a .Tg is attached to a paragraph, attach the permalink to the first word, or the first few words if they are short. --- mdoc_html.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'mdoc_html.c') diff --git a/mdoc_html.c b/mdoc_html.c index dd0f1235..bff4757f 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.338 2020/04/06 10:16:17 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.339 2020/04/18 20:40:10 schwarze Exp $ */ /* * Copyright (c) 2014-2020 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons @@ -377,10 +377,13 @@ print_mdoc_node(MDOC_ARGS) } t = h->tag; t->refcnt++; - if (NODE_DELIMC & n->flags) + if (n->flags & NODE_DELIMC) h->flags |= HTML_NOSPACE; - print_text(h, n->string); - if (NODE_DELIMO & n->flags) + if (n->flags & NODE_HREF) + print_tagged_text(h, n->string, n); + else + print_text(h, n->string); + if (n->flags & NODE_DELIMO) h->flags |= HTML_NOSPACE; break; case ROFFT_EQN: -- cgit v1.2.3-56-ge451