aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-04-18 20:40:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-04-18 20:40:10 +0000
commitfcd488027f8d6316b641cffa970d451df8a92c76 (patch)
treed6d2d4b2d01db1839ff1d98268209c616b5304bb /mdoc_html.c
parent637b922ab2b2aa18419a0abed18ae9d2fed4e50a (diff)
downloadmandoc-fcd488027f8d6316b641cffa970d451df8a92c76.tar.gz
mandoc-fcd488027f8d6316b641cffa970d451df8a92c76.tar.zst
mandoc-fcd488027f8d6316b641cffa970d451df8a92c76.zip
When a .Tg is attached to a paragraph, attach the permalink
to the first word, or the first few words if they are short.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c11
1 files changed, 7 insertions, 4 deletions
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 <schwarze@openbsd.org>
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -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: