[GH-ISSUE #1576] MD045: Do not fire if aria-hidden=true #2559

Closed
opened 2026-03-07 20:08:53 +03:00 by kerem · 0 comments
Owner

Originally created by @martincostello on GitHub (Apr 25, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1576

If an inline image is specified as HTML to control sizing, MD045 fires even if the aria-hidden="true" attribute is included on the img element to hide the image from assistive technologies.

For example for a project logo:

<img src="logo.png" width="200" height="200" aria-hidden="true" />
MD045/no-alt-text: Images should have alternate text (alt text)

This can improve the experience for assistive technology users by hiding:

Purely decorative content, such as icons or images

In this context, the image is purely decorative, so there's no need to describe it as it can just be hidden.

Originally created by @martincostello on GitHub (Apr 25, 2025). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1576 If an inline image is specified as HTML to control sizing, MD045 fires even if the [`aria-hidden="true"`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-hidden) attribute is included on the `img` element to hide the image from assistive technologies. For example for a project logo: ```md <img src="logo.png" width="200" height="200" aria-hidden="true" /> ``` ```text MD045/no-alt-text: Images should have alternate text (alt text) ``` > This can improve the experience for assistive technology users by hiding: > > Purely decorative content, such as icons or images In this context, the image is purely decorative, so there's no need to describe it as it can just be hidden.
kerem 2026-03-07 20:08:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#2559
No description provided.