squizlabs/HTML_CodeSniffer

False positives for CJK named anchors

Opened this issue · 0 comments

When running pa11y with htmlcs as the runner, I'm getting this false positive:

Error: This link points to a named anchor "%E3%81%BE%E3%81%A8%E3%82%81" within the document, but no anchor exists with that name.
[htmlcs: WCAG2AA.Principle2.Guideline2_4.2_4_1.G1,G123,G124.NoSuchID](https://squizlabs.github.io/HTML_CodeSniffer/Standards/WCAG2/#sc2_4_1)

Here's the code, produced by Markdown:

<p>Here is a link: <a href="#%E3%81%BE%E3%81%A8%E3%82%81">Go to summary</a></p>
<h2 name="まとめ">まとめ</h2>
<p>Summary</p>

This is a valid link; %E3%81%BE%E3%81%A8%E3%82%81 converts to まとめ, but CodeSniffer can't parse it, so the test fails even though it should pass.