=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.269 retrieving revision 1.270 diff -u -p -r1.269 -r1.270 --- mandoc/html.c 2020/04/19 15:16:56 1.269 +++ mandoc/html.c 2020/04/20 13:07:24 1.270 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.269 2020/04/19 15:16:56 schwarze Exp $ */ +/* $Id: html.c,v 1.270 2020/04/20 13:07:24 schwarze Exp $ */ /* * Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons @@ -383,11 +383,12 @@ html_make_id(const struct roff_node *n, int unique) * permitted in URL-fragment strings according to the * explicit list at: * https://url.spec.whatwg.org/#url-fragment-string + * In addition, reserve '~' for ordinal suffixes. */ for (cp = buf; *cp != '\0'; cp++) if (isalnum((unsigned char)*cp) == 0 && - strchr("!$&'()*+,-./:;=?@_~", *cp) == NULL) + strchr("!$&'()*+,-./:;=?@_", *cp) == NULL) *cp = '_'; if (unique == 0) @@ -407,7 +408,7 @@ html_make_id(const struct roff_node *n, int unique) if (entry->ord > 1) { cp = buf; - mandoc_asprintf(&buf, "%s_%d", cp, entry->ord); + mandoc_asprintf(&buf, "%s~%d", cp, entry->ord); free(cp); } return buf;