mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-03-11 12:52:34 +01:00
Update MD045/no-alt-text to report instances of HTML "img" tags missing an "alt" attribute (fixes #992).
This commit is contained in:
parent
0afedaebf4
commit
531e58ed9a
18 changed files with 274 additions and 25 deletions
|
|
@ -28,5 +28,43 @@ Multi-line image with alternate text  {MD045:28}
|
||||
|
||||
<!-- markdownlint-disable no-inline-html -->
|
||||
|
||||
Image tag with alt attribute set to text
|
||||
<img src="image.png" alt="Descriptive text" />
|
||||
|
||||
Image tag with alt attribute not set
|
||||
<img src="image.png" alt> {MD045}
|
||||
|
||||
Image tag with alt attribute set to decorative with an empty double-quote string
|
||||
<img src="image.png" alt="" />
|
||||
|
||||
Image tag with alt attribute set to decorative with an empty single-quote string
|
||||
<img src="image.png" alt='' />
|
||||
|
||||
Image tag with no alt attribute <img src="image.png" /> {MD045}
|
||||
|
||||
Multi-line image tag with no alt text
|
||||
<img
|
||||
src="image.png"> {MD045:48}
|
||||
|
||||
Multi-line image tag with alt attribute not set
|
||||
<img
|
||||
src="image.png"
|
||||
alt> {MD045:52}
|
||||
|
||||
Multi-line image tag with alt text
|
||||
<img
|
||||
src="image.png"
|
||||
alt="Description"
|
||||
>
|
||||
|
||||
Uppercase image tag with alt attribute set
|
||||
<IMG SRC="cat.png" ALT="Descriptive text">
|
||||
|
||||
Uppercase image tag with no alt set <IMG SRC="cat.png" /> {MD045}
|
||||
|
||||
<!-- markdownlint-restore no-inline-html -->
|
||||
|
||||
[notitle]: image.jpg
|
||||
[title]: image.jpg "Title"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue