ryersondmp / sa11y

Sa11y is an accessibility quality assurance tool that visually highlights common accessibility and usability issues. Geared towards content authors, Sa11y straightforwardly identifies errors or warnings at the source with a simple tooltip on how to fix them.
https://sa11y.netlify.app
Other
280 stars 43 forks source link

check for encoded URLs in same-page links #82

Closed hollsk closed 4 months ago

hollsk commented 4 months ago

Hello! Thanks for all your work on this project - it's very popular here at Springer Nature 😄 there really was a huge gap in the market for a tool like this and I'm so glad you've filled it.

One of our customer services advisors was using it on a support page generated by a third party vendor (Freshdesk). She found that Sa11y was triggering its broken same-page links rule because the 3rd party CMS was using encoded URIs in same page hrefs, but the associated IDs just used the plain text.

This works fine in the browser, but because Sa11y is doing a straight string comparison, the "matching" IDs aren't getting picked up. This change adds an attempt to decode the URI too and see if that can get a match.

I haven't added a unit test because I'm not familiar enough with Playwright, sorry! I pinky promise I've tested it offline though, and if you're willing to hold my hand a bit, I can add one for Playwright.

You can see an example of an affected page here. Our customer services folks are planning to update these pages soon, but I'm hoping it'll stay replicable for long enough for you to see what I mean - note the simplified Chinese characters in the IDs, and the encoded characters in the list of same page URLs at the top of the page.

Thanks again!

adamchaboryk commented 4 months ago

Hey @hollsk,

Great to hear that it's popular within your org. 😊

Thanks for catching this bug! This is a new check I only recently implemented. I'm currently fixing another bug, but I'll be sure to incorporate your fix next release (before end of week hopefully).

Thanks again for the contribution!!