diff options
-rw-r--r-- | html.c | 8 | ||||
-rw-r--r-- | mdoc_html.c | 6 |
2 files changed, 6 insertions, 8 deletions
@@ -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); } diff --git a/mdoc_html.c b/mdoc_html.c index 82d7ca03..ee986acc 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.238 2015/10/12 00:08:15 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.239 2016/01/04 12:45:29 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -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); |