wjdp / htmltest

:white_check_mark: Test generated HTML for problems
MIT License
323 stars 54 forks source link

IgnoreAltEmpty option for alt="" decorative images #200

Closed jhunt closed 1 year ago

jhunt commented 1 year ago

Introduces a new configuration option, IgnoreAltEmpty for allowing alt attribute checks against images, while being more lenient with explicit empty alt attributes. WAI instructs HTML practitioners to set an explicitly empty alt attribute for decorative images that offer no additional context or meaningful information to a page, so that they can be skipped by screen readers:

https://www.w3.org/WAI/tutorials/images/decorative/

Fixes #153

I have been using this on my own fork to validate https://vivanti.com/