You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Image block: screen readers announce "figure" for images that have alt text but no caption #86817
The Image block always wraps the image in <figure>, even when there's no caption:
<figureclass="wp-block-image size-large"><imgsrc="…" alt="On a light-blue background, a calendar page…"></figure>
Without a <figcaption>, the figure role gives users no extra information, but NVDA still announces it: "figure, graphic, On a light-blue background…". On a page with many images, this adds noise before every one. A bare <img> with the same alt text is read correctly as "graphic, On a light-blue background…".
To work around it, the reporter swapped Image blocks for Custom HTML. That isn't a realistic option for most site builders, and it means losing the editor's alt-text field.
Possible fixes:
Don't output <figure> when there's no caption.
Or keep the wrapper for styling and add role="none" to the <figure> when there's no caption.
This differs from #75027 (decorative images with empty alt text) and #79572 (role="none" on the img). This issue is about images that do have alt text, which is the common case. Changing the markup for images without captions may affect theme styles that target figure.wp-block-image, so the role="none" option may be the safer one.
Step-by-step reproduction instructions
Add an Image block, set alt text, and leave the caption empty.
View the page on the frontend with NVDA in Edge.
Move to the image. NVDA says "figure" before the image and its alt text.
Environment info
NVDA + Microsoft Edge (Windows), on WordPress.com.
Activity