summaryrefslogtreecommitdiffstats
path: root/html.c
diff options
context:
space:
mode:
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);
}