=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.229 retrieving revision 1.235 diff -u -p -r1.229 -r1.235 --- mandoc/html.c 2018/05/25 20:23:51 1.229 +++ mandoc/html.c 2018/06/25 13:45:57 1.235 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.229 2018/05/25 20:23:51 schwarze Exp $ */ +/* $Id: html.c,v 1.235 2018/06/25 13:45:57 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze @@ -69,8 +69,6 @@ static const struct htmldata htmltags[TAG_MAX] = { {"br", HTML_NOSTACK | HTML_AUTOCLOSE | HTML_NLALL}, {"a", 0}, {"table", HTML_NLALL | HTML_INDENT}, - {"colgroup", HTML_NLALL | HTML_INDENT}, - {"col", HTML_NOSTACK | HTML_AUTOCLOSE | HTML_NLALL}, {"tr", HTML_NLALL | HTML_INDENT}, {"td", HTML_NLAROUND}, {"li", HTML_NLAROUND | HTML_INDENT}, @@ -287,10 +285,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 +692,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. */ @@ -703,11 +701,6 @@ print_otag(struct html *h, enum htmltag tag, const cha } fmt++; } - if (*fmt == '-') { - if (su != NULL) - su->scale *= -1.0; - fmt++; - } break; default: abort(); @@ -718,9 +711,6 @@ print_otag(struct html *h, enum htmltag tag, const cha switch (*fmt++) { case 'h': attr = "height"; - break; - case 'i': - attr = "text-indent"; break; case 'l': attr = "margin-left";