Sha256: 586306ec5c53fe6b672d0b23ef19f0f33702f4774e361e306f182d6f6eb59784

Contents?: true

Size: 533 Bytes

Versions: 375

Compression:

Stored size: 533 Bytes

Contents

// 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)
);

Version data entries

375 entries across 375 versions & 1 rubygems

Version Path
govuk_publishing_components-30.4.1 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-30.4.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-30.3.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-30.2.1 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-30.2.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-30.1.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-30.0.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.15.3 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.15.2 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.15.1 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.15.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.14.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.13.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.12.1 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.12.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.11.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.10.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.9.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.8.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js
govuk_publishing_components-29.7.0 node_modules/axe-core/lib/rules/xml-lang-mismatch-matches.js