summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--html.c6
-rw-r--r--mdoc_html.c4
2 files changed, 4 insertions, 6 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);
}
diff --git a/mdoc_html.c b/mdoc_html.c
index 28f33083..e67817fa 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -542,7 +542,6 @@ mdoc_sh_pre(MDOC_ARGS)
}
bufinit(h);
- bufcat(h, "x");
for (n = n->child; n != NULL && n->type == ROFFT_TEXT; ) {
bufcat_id(h, n->string);
@@ -572,7 +571,6 @@ mdoc_ss_pre(MDOC_ARGS)
return 1;
bufinit(h);
- bufcat(h, "x");
for (n = n->child; n != NULL && n->type == ROFFT_TEXT; ) {
bufcat_id(h, n->string);
@@ -1063,7 +1061,7 @@ mdoc_sx_pre(MDOC_ARGS)
struct htmlpair tag[2];
bufinit(h);
- bufcat(h, "#x");
+ bufcat(h, "#");
for (n = n->child; n; ) {
bufcat_id(h, n->string);