version 1.191, 2015/10/13 22:59:54 |
version 1.193, 2017/01/08 16:38:26 |
Line 662 buffmt_includes(struct html *h, const char *name) |
|
Line 662 buffmt_includes(struct html *h, const char *name) |
|
while (NULL != (p = strchr(pp, '%'))) { |
while (NULL != (p = strchr(pp, '%'))) { |
bufncat(h, pp, (size_t)(p - pp)); |
bufncat(h, pp, (size_t)(p - pp)); |
switch (*(p + 1)) { |
switch (*(p + 1)) { |
case'I': |
case 'I': |
bufcat(h, name); |
bufcat(h, name); |
break; |
break; |
default: |
default: |
|
|
bufcat_id(struct html *h, const char *src) |
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) |
for (; '\0' != *src; src++) |
bufcat_fmt(h, "%.2x", *src++); |
bufncat(h, *src == ' ' ? "_" : src, 1); |
} |
} |