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

Heading check misses first instance of large bold text following a heading. #71

Closed gregrgay closed 7 months ago

gregrgay commented 7 months ago

Might be a bug in the "Is this a heading" check. I have a page with two bold one word paragraphs ending in a colon, separated by a paragraph of text. In the example below, only "Disadvantages:" gets flagged. It happens when the first instance follows a heading of any level, but not if it appears after something else.

e.g.

[the main heading]

Advantages:

[some more text content]

Disadvantages:

[some more text content]

Looking at src/js/rulesets/quality-assurance line #198 I see ignoresElements contains all the heading levels and ignores them for this check. Removing the H1 & H2 from the list fixes the issue for our purposes, though not sure what else that would affect. My thinking is headings should be removed from the list. Not sure if there's some other reason why bold text after headings should be ignored.

There will be scenarios where two or more headings, of different levels, follow in sequence.

adamchaboryk commented 7 months ago

Fake heading detection logic was improved in version 3.0.6 — although the rationale for this old logic was to minimize false positives/excessive warnings.

New fake heading logic doesn't check for what the previous element is!