All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
'use strict'
|
|
|
|
// Maps of subsets.
|
|
// Each value is a matrix of tuples.
|
|
// The first value causes parse errors, the second is valid.
|
|
// Of both values, the first value is unsafe, and the second is safe.
|
|
module.exports = {
|
|
// See: <https://html.spec.whatwg.org/#attribute-name-state>.
|
|
name: [
|
|
['\t\n\f\r &/=>'.split(''), '\t\n\f\r "&\'/=>`'.split('')],
|
|
['\0\t\n\f\r "&\'/<=>'.split(''), '\0\t\n\f\r "&\'/<=>`'.split('')]
|
|
],
|
|
// See: <https://html.spec.whatwg.org/#attribute-value-(unquoted)-state>.
|
|
unquoted: [
|
|
['\t\n\f\r &>'.split(''), '\0\t\n\f\r "&\'<=>`'.split('')],
|
|
['\0\t\n\f\r "&\'<=>`'.split(''), '\0\t\n\f\r "&\'<=>`'.split('')]
|
|
],
|
|
// See: <https://html.spec.whatwg.org/#attribute-value-(single-quoted)-state>.
|
|
single: [
|
|
["&'".split(''), '"&\'`'.split('')],
|
|
["\0&'".split(''), '\0"&\'`'.split('')]
|
|
],
|
|
// See: <https://html.spec.whatwg.org/#attribute-value-(double-quoted)-state>.
|
|
double: [
|
|
['"&'.split(''), '"&\'`'.split('')],
|
|
['\0"&'.split(''), '\0"&\'`'.split('')]
|
|
]
|
|
}
|