=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.229 retrieving revision 1.231 diff -u -p -r1.229 -r1.231 --- mandoc/html.c 2018/05/25 20:23:51 1.229 +++ mandoc/html.c 2018/05/29 02:10:10 1.231 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.229 2018/05/25 20:23:51 schwarze Exp $ */ +/* $Id: html.c,v 1.231 2018/05/29 02:10:10 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze @@ -287,10 +287,16 @@ html_make_id(const struct roff_node *n, int unique) if (buf == NULL) return NULL; - /* http://www.w3.org/TR/html5/dom.html#the-id-attribute */ + /* + * In ID attributes, only use ASCII characters that are + * permitted in URL-fragment strings according to the + * explicit list at: + * https://url.spec.whatwg.org/#url-fragment-string + */ for (cp = buf; *cp != '\0'; cp++) - if (*cp == ' ') + if (isalnum((unsigned char)*cp) == 0 && + strchr("!$&'()*+,-./:;=?@_~", *cp) == NULL) *cp = '_'; if (unique == 0) @@ -688,12 +694,6 @@ print_otag(struct html *h, enum htmltag tag, const cha su = &mysu; a2width(arg2, su); } - if (*fmt == '*') { - if (su != NULL && su->unit == SCALE_EN && - su->scale > 5.9 && su->scale < 6.1) - su = NULL; - fmt++; - } if (*fmt == '+') { if (su != NULL) { /* Make even bold text fit. */ @@ -701,11 +701,6 @@ print_otag(struct html *h, enum htmltag tag, const cha /* Add padding. */ su->scale += 3.0; } - fmt++; - } - if (*fmt == '-') { - if (su != NULL) - su->scale *= -1.0; fmt++; } break;