mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 05:50:13 +01:00
Update MD045/no-alt-text to allow violations when an HTML IMG has aria-hidden set to true (fixes #1576).
This commit is contained in:
parent
faf96d513b
commit
b611eba684
7 changed files with 70 additions and 4 deletions
|
|
@ -68,6 +68,18 @@ Uppercase image tag with no alt set <IMG SRC="cat.png" /> {MD045}
|
|||
<img src="image.png" /> {MD045}
|
||||
</p>
|
||||
|
||||
No alt attribute is okay when the image is hidden from assistive technology:
|
||||
<img src="image.png" aria-hidden="true"/>
|
||||
<img src="image.png" ARIA-HIDDEN="TRUE" />
|
||||
|
||||
But not when disabled: <img src="image.png" aria-hidden="false"/> {MD045}
|
||||
|
||||
Multi-line image tag aria-hidden:
|
||||
<img
|
||||
src="image.png"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
|
||||
<!-- markdownlint-restore no-inline-html -->
|
||||
|
||||
[notitle]: image.jpg
|
||||
|
|
|
|||
|
|
@ -42681,6 +42681,22 @@ Generated by [AVA](https://avajs.dev).
|
|||
'no-alt-text',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
24,
|
||||
42,
|
||||
],
|
||||
fixInfo: null,
|
||||
lineNumber: 75,
|
||||
ruleDescription: 'Images should have alternate text (alt text)',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md045.md',
|
||||
ruleNames: [
|
||||
'MD045',
|
||||
'no-alt-text',
|
||||
],
|
||||
},
|
||||
],
|
||||
fixed: `# Images with and without alternate text␊
|
||||
␊
|
||||
|
|
@ -42752,6 +42768,18 @@ Generated by [AVA](https://avajs.dev).
|
|||
<img src="image.png" /> {MD045}␊
|
||||
</p>␊
|
||||
␊
|
||||
No alt attribute is okay when the image is hidden from assistive technology:␊
|
||||
<img src="image.png" aria-hidden="true"/>␊
|
||||
<img src="image.png" ARIA-HIDDEN="TRUE" />␊
|
||||
␊
|
||||
But not when disabled: <img src="image.png" aria-hidden="false"/> {MD045}␊
|
||||
␊
|
||||
Multi-line image tag aria-hidden:␊
|
||||
<img␊
|
||||
src="image.png"␊
|
||||
aria-hidden="true"␊
|
||||
/>␊
|
||||
␊
|
||||
<!-- markdownlint-restore no-inline-html -->␊
|
||||
␊
|
||||
[notitle]: image.jpg␊
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue