aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-01-04 12:45:29 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-01-04 12:45:29 +0000
commitfc78f53cd921d410f5a0cc2831a9a8791a0a7a8f (patch)
treee9cfd260b3bd9b2d92a53963eb0f8d742f5cb6f9 /html.c
parent9eda08d3cc9d1228f998710fc39a87bab426a154 (diff)
downloadmandoc-fc78f53cd921d410f5a0cc2831a9a8791a0a7a8f.tar.gz
mandoc-fc78f53cd921d410f5a0cc2831a9a8791a0a7a8f.tar.zst
mandoc-fc78f53cd921d410f5a0cc2831a9a8791a0a7a8f.zip
Generate simpler in-page links: just replace spaces with underscores.
Patch from bentley@.
Diffstat (limited to 'html.c')
-rw-r--r--html.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/html.c b/html.c
index d734f546..adff053c 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.191 2015/10/13 22:59:54 schwarze Exp $ */
+/* $Id: html.c,v 1.192 2016/01/04 12:45:29 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -720,8 +720,8 @@ void
bufcat_id(struct html *h, const char *src)
{
- /* Cf. <http://www.w3.org/TR/html4/types.html#h-6.2>. */
+ /* Cf. <http://www.w3.org/TR/html5/dom.html#the-id-attribute>. */
- while ('\0' != *src)
- bufcat_fmt(h, "%.2x", *src++);
+ for (; '\0' != *src; src++)
+ bufncat(h, *src == ' ' ? "_" : src, 1);
}