version 1.229, 2018/05/25 20:23:51 |
version 1.234, 2018/06/25 13:26:57 |
Line 287 html_make_id(const struct roff_node *n, int unique) |
|
Line 287 html_make_id(const struct roff_node *n, int unique) |
|
if (buf == NULL) |
if (buf == NULL) |
return 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++) |
for (cp = buf; *cp != '\0'; cp++) |
if (*cp == ' ') |
if (isalnum((unsigned char)*cp) == 0 && |
|
strchr("!$&'()*+,-./:;=?@_~", *cp) == NULL) |
*cp = '_'; |
*cp = '_'; |
|
|
if (unique == 0) |
if (unique == 0) |
Line 688 print_otag(struct html *h, enum htmltag tag, const cha |
|
Line 694 print_otag(struct html *h, enum htmltag tag, const cha |
|
su = &mysu; |
su = &mysu; |
a2width(arg2, su); |
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 (*fmt == '+') { |
if (su != NULL) { |
if (su != NULL) { |
/* Make even bold text fit. */ |
/* Make even bold text fit. */ |
Line 703 print_otag(struct html *h, enum htmltag tag, const cha |
|
Line 703 print_otag(struct html *h, enum htmltag tag, const cha |
|
} |
} |
fmt++; |
fmt++; |
} |
} |
if (*fmt == '-') { |
|
if (su != NULL) |
|
su->scale *= -1.0; |
|
fmt++; |
|
} |
|
break; |
break; |
default: |
default: |
abort(); |
abort(); |
Line 718 print_otag(struct html *h, enum htmltag tag, const cha |
|
Line 713 print_otag(struct html *h, enum htmltag tag, const cha |
|
switch (*fmt++) { |
switch (*fmt++) { |
case 'h': |
case 'h': |
attr = "height"; |
attr = "height"; |
break; |
|
case 'i': |
|
attr = "text-indent"; |
|
break; |
break; |
case 'l': |
case 'l': |
attr = "margin-left"; |
attr = "margin-left"; |