diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-01-04 12:45:29 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-01-04 12:45:29 +0000 |
commit | aadb0f1f34c6e1c8b974e8b12e89f53f6edc2d70 (patch) | |
tree | 1dd3cd528a37fd9a4be2c03f95da2fee8bfef94c /html.c | |
parent | 56a48084a788f82cc25b032b989926704f806fee (diff) | |
download | mandoc-aadb0f1f34c6e1c8b974e8b12e89f53f6edc2d70.tar.gz |
Generate simpler in-page links: just replace spaces with underscores.
Patch from bentley@.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); } |