summaryrefslogtreecommitdiffstats
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
commitaadb0f1f34c6e1c8b974e8b12e89f53f6edc2d70 (patch)
tree1dd3cd528a37fd9a4be2c03f95da2fee8bfef94c /html.c
parent56a48084a788f82cc25b032b989926704f806fee (diff)
downloadmandoc-aadb0f1f34c6e1c8b974e8b12e89f53f6edc2d70.tar.gz
Generate simpler in-page links: just replace spaces with underscores.
Patch from bentley@.
Diffstat (limited to 'html.c')
-rw-r--r--html.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/html.c b/html.c
index d394748f..5d7dbb3e 100644
--- a/html.c
+++ b/html.c
@@ -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);
}