False negative on wcag/h30
Provide a broad description of the bug.
Reduced test-case
This code is outputting an error wcag/h30
<a alt="close left sidebar" class="btn btn-danger cursor_pointer close" data-action="close" data-side="left">
<span alt="close left sidebar"></span>
</a>
I have the alt
attribute on both the a
element and span
element, but still the error is being thrown
Configuration
const htmlvalidate = new HTMLValidate({
extends: ['html-validate:recommended'],
rules: {
'no-trailing-whitespace': 'off',
'attr-case': 'off',
'long-title': 'off'
}
})
Expected result
I'd expect no error since alt
is provided on a
element
Actual result
{
ruleId: 'WCAG/H30',
severity: 2,
message: 'Anchor link must have a text describing its purpose',
offset: 6267,
line: 108,
column: 22,
size: 1,
selector: 'html > body > main > div:nth-child(1) > div:nth-child(1) > div > a',
context: undefined
}
Version
-
html-validate
: 2.16.0