You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
533 B
13 lines
533 B
// using -> "selector": "html[lang][xml\\:lang]" to narrow down html with lang and xml:lang attributes
|
|
|
|
// get primary base language for each of the attributes
|
|
const { getBaseLang } = axe.utils;
|
|
const primaryLangValue = getBaseLang(node.getAttribute('lang'));
|
|
const primaryXmlLangValue = getBaseLang(node.getAttribute('xml:lang'));
|
|
|
|
// ensure that the value specified is valid lang for both `lang` and `xml:lang`
|
|
return (
|
|
axe.utils.validLangs().includes(primaryLangValue) &&
|
|
axe.utils.validLangs().includes(primaryXmlLangValue)
|
|
);
|