itmaybejj / editoria11y-wp

WordPress wrapper for Editoria11y
GNU General Public License v2.0
6 stars 2 forks source link

Weird error for two nearby links #28

Closed cbirdsong closed 4 months ago

cbirdsong commented 4 months ago

I've got two links here, and the first one is flagged with an error and a warning:

CleanShot 2024-05-14 at 16 47 40

"Download" is a legit link (if a little ambiguous):

<a class="wp-block-button__link wp-element-button" href="http://knockknockmuseum.local/wp-content/uploads/2024/03/KKCM_Educators-Guide-Evergreen.pdf">Download</a>

"View" is missing an href entirely:

<a class="wp-block-button__link wp-element-button">View</a>

However, editoria11y is ignoring the "View" link and has flagged the "Download" link with the error "Link with no accessible text": CleanShot 2024-05-14 at 16 51 34

Compounding the weirdness:

I really have no idea what might be going wrong here. These are contained within custom blocks inside a custom grid layout container so you can't see run the code directly, but here's some snippets of the entire chunk of the page, and I could probably provide a zip file of the theme/site via email if that helps?

HTML as serialized in the editor ```html

Educator Guide

Your one-stop reference guide for all the wonderful, educational programming Knock Knock has to offer. Our self-guided field trips allow your students to have the time of their lives playing with purpose. The guide also has step-by-step instructions for booking your field trip. Don’t let your students miss out on all that Knock Knock has to offer.

Knock Knock Curriculum Guide

Our museum’s Learning Zones and programs provide teaching and learning opportunities that correspond with Louisiana’s state Early Learning and Elementary School Standards.

```
HTML displayed on the front end ```html

Educator Guide

Your one-stop reference guide for all the wonderful, educational programming Knock Knock has to offer. Our self-guided field trips allow your students to have the time of their lives playing with purpose. The guide also has step-by-step instructions for booking your field trip. Don’t let your students miss out on all that Knock Knock has to offer.

Knock Knock Curriculum Guide

Our museum’s Learning Zones and programs provide teaching and learning opportunities that correspond with Louisiana’s state Early Learning and Elementary School Standards.

```
itmaybejj commented 4 months ago

Oh.

Good timing; I ran into this false positive in the Drupal side and had forgotten to port the fix for this release; I'll go fetch that code tomorrow.

As for the <a> without an href-- an a without an href is a named anchor, not a link. The default settings ignore them so as not to false positive on things like skip-to-content target anchors. And screen readers will not announce them as links, so they're a spicy little problem.

itmaybejj commented 4 months ago

...are there WordPress plugins that output an a without an anchor or is that custom code?

cbirdsong commented 4 months ago

That's just the stock buttons block.

itmaybejj commented 4 months ago

Ahh I see; until a link is added, it outputs an <a> without an HREF that does nothing.

So...that's...broken...in all kinds of ways that the link checker is not designed to check.

I'm...tempted to write a WordPress-specific test that fires a hard error on "a.wp-element-button(:not('href'))"...

cbirdsong commented 4 months ago

Flagging that with at least a warning would definitely be welcome.

itmaybejj commented 4 months ago

If you are interested in testing, PR 26 includes fixes for both of these.

itmaybejj commented 4 months ago

1.0.15