Sha256: 66b8ec16309466a5849926d4f077f5d39fadddc4e5d06fe7dce745848f014bcc

Contents?: true

Size: 256 Bytes

Versions: 14

Compression:

Stored size: 256 Bytes

Contents

const { isXHTML } = axe.utils;

const langValue = (node.getAttribute(`lang`) || '').trim();
const xmlLangValue = (node.getAttribute(`xml:lang`) || '').trim();

if (!langValue && !isXHTML(document)) {
	return false;
}

return !!(langValue || xmlLangValue);

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
govuk_publishing_components-21.37.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.36.1 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.36.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.35.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.34.1 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.34.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.33.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.32.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.31.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.30.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.29.1 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.29.0 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.28.1 node_modules/axe-core/lib/checks/language/has-lang.js
govuk_publishing_components-21.28.0 node_modules/axe-core/lib/checks/language/has-lang.js