a11y-lint 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/a11y/lint/rules/image_tag_missing_alt.rb +16 -10
- data/lib/a11y/lint/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c000b195d8308dc83a3480df00e9a469e064535305ece969f779ee05b93fc87
|
|
4
|
+
data.tar.gz: cf3ec59befbf3057ff5f1a9d971925656fbf0f0c001e40780202abd862bd67a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad3e23e799fce7418f9e28224a9ec63120f42d5a04bd27710637df12e278118728af0a3baf47c5fe8b3cfa2a12e6bfbc366d8f334a453b385111b1befc2828df
|
|
7
|
+
data.tar.gz: 8be4c61819523edcbb0a11bb4959ab5834b0552d0fe27be2fc71aa30362dc18eb5ca8f9d25bffa5578f7f77d0af11b5e1716e8429b4c2a865fcd3a243031ede0
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.3.1] - 2026-03-27
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `ImageTagMissingAlt` rule: detect `image_tag` nested inside `link_to` and other helper calls
|
|
15
|
+
|
|
10
16
|
## [0.3.0] - 2026-03-27
|
|
11
17
|
|
|
12
18
|
### Added
|
|
@@ -27,16 +27,22 @@ module A11y
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def extract_image_tag_call(sexp)
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
return unless sexp.is_a?(Array)
|
|
31
|
+
return sexp if image_tag_call?(sexp)
|
|
32
|
+
|
|
33
|
+
sexp.each do |child|
|
|
34
|
+
result = extract_image_tag_call(child)
|
|
35
|
+
return result if result
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
nil
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def image_tag_call?(sexp)
|
|
42
|
+
case sexp
|
|
43
|
+
in [:command, [:@ident, "image_tag", *], *] then true
|
|
44
|
+
in [:method_add_arg, [:fcall, [:@ident, "image_tag", *]], *] then true
|
|
45
|
+
else false
|
|
40
46
|
end
|
|
41
47
|
end
|
|
42
48
|
|
data/lib/a11y/lint/version.rb
CHANGED