axe-core
axe-core copied to clipboard
valid-lang should check that there is actual content
For consistency with the Element with lang attribute has valid language tag ACT rule, axe-core should make sure that the valid-lang rule does not fail elements that are empty, or that only contain whitespace characters.
Here are some of the ACT example we're failing, when we shouldn't be:
Passed example 4
<article lang="invalid">
<div lang="en">
They wandered into a strange Tiki bar on the edge of the small beach town.
</div>
</article>
Inapplicable example 3
<p lang="hidden">
<span style="display: none;">
They wandered into a strange Tiki bar on the edge of the small beach town.
</span>
</p>
Inapplicable example 4
<div lang="invalid">
<img src="/WAI/content-assets/wcag-act-rules/test-assets/shared/fireworks.jpg" alt="" />
</div>
👋 we used is-language-code when implementing the --lang flag in ember-cli. Sharing in case it's useful! Thank you for all you do! 👍
Thanks Melanie! That looks a little too strict for what we want in axe-core though. Plus the size of it is a bit of an issue. Either way, appreciate the suggestion.
Glad you like our work, if you're ever interested to help, get in touch. I hear good things about your work on Ember too!
Validate with the latest develop branch code base,
test Script: <div id="target"><span lang="en"> text </span></div>
