summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mandoc/html.c8
-rw-r--r--usr.bin/mandoc/mdoc_html.c6
2 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 3502ea91c6b..a1bee3ea015 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.61 2015/10/13 22:57:49 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.62 2015/12/25 20:43:04 bentley Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -718,8 +718,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/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index b5eba071da0..b61a3a04e65 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.113 2015/10/12 00:07:27 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.114 2015/12/25 20:43:04 bentley Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -540,7 +540,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);
@@ -570,7 +569,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);
@@ -1061,7 +1059,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);