Repository navigation
v2.0.2 - New Feature: Aria-Hidden Attribute for Cover Blocks
Accessibility Improvement: Aria-Hidden Attribute for Cover Blocks
In this release, we've introduced an enhancement to the rendering of cover blocks. This improvement targets the accessibility of background images that don't have alt tags.
Previously, background images of cover blocks without alt tags were not hidden from screen readers. This could lead to confusion as these images are often decorative and not necessary for understanding the content.
The render_block method in the Aria_Attributes class has been updated to automatically add the aria-hidden="true" attribute to such images. Here's a brief overview of the changes:
- Added a step to parse the block content and find
imgelements withoutalttags. - Added a step to add the
aria-hidden="true"attribute to theseimgelements. - Updated the step that returns the modified block content to include these changes.
This enhancement ensures that screen readers correctly ignore decorative images, improving the accessibility of websites using our plugin.