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