axe-core
Version:
Accessibility engine for automated Web UI testing
16 lines (11 loc) • 293 B
JavaScript
var ariaHeadingLevel = node.getAttribute('aria-level');
if (ariaHeadingLevel !== null) {
this.data(parseInt(ariaHeadingLevel, 10));
return true;
}
var headingLevel = node.tagName.match(/H(\d)/);
if (headingLevel) {
this.data(parseInt(headingLevel[1], 10));
return true;
}
return true;