Skip to content

Commit 0fe74d8

Browse files
Matty JWilcoFiers
authored andcommitted
fix(image-alt): Exclude svg[role="img"] elements (#683)
1 parent ca54f42 commit 0fe74d8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/rules/image-alt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "image-alt",
3-
"selector": "img, [role='img']",
3+
"selector": "img, [role='img']:not(svg)",
44
"tags": [
55
"cat.text-alternatives",
66
"wcag2a",

test/integration/rules/image-alt/image-alt.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
<img src="img.jpg" id="pass8" aria-labelledby="ninjamonkeys">
1717
<div role="img" alt="blah" id="violation6"></div>
1818
<div role="img" aria-label="blah" id="pass9"></div>
19+
<svg role="img" id="ignore1"><title>SVG Title</title></svg>

0 commit comments

Comments
 (0)