a11y-lint 0.7.0 → 0.7.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 +8 -0
- data/lib/a11y/lint/slim_runner.rb +14 -0
- 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: 6fe6daf54c27923c7bb8d7c200baab018d5643ae6d17f1da3116b90b8b9a9b1a
|
|
4
|
+
data.tar.gz: 866c2a9cdbeddc1d8b4c726e89a104b4b193070fb52ec1ae45c6552fee41afe1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d07bed9bdc71ef0d08f6aa097c5c2550988c11899106e0ceeaaaf54a2c5243449842dd20390b321fdbbcf54811bc53a1487cbb502ac75698224dec99e13599c
|
|
7
|
+
data.tar.gz: a7ef305af11a87604e4f95ca3cfd62afa7c142601d9c081ec2448747414fef7ae32a11020134cebaddb4954c788eec5688251d18332d7079d8b531f98015ab6f
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.7.1] - 2026-04-13
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Slim runner: correct line numbers in templates with multiline backslash continuations
|
|
15
|
+
|
|
8
16
|
## [0.7.0] - 2026-04-13
|
|
9
17
|
|
|
10
18
|
### Added
|
|
@@ -27,6 +27,7 @@ module A11y
|
|
|
27
27
|
@line += 1 if sexp[0] == :newline
|
|
28
28
|
new_node = Node.new(sexp, line: @line)
|
|
29
29
|
check_node(new_node) if html_tag?(sexp) || slim_output?(sexp)
|
|
30
|
+
@line += continuation_newlines(sexp)
|
|
30
31
|
sexp.each { |child| walk(child) }
|
|
31
32
|
end
|
|
32
33
|
|
|
@@ -38,6 +39,19 @@ module A11y
|
|
|
38
39
|
sexp[0] == :slim && sexp[1] == :output
|
|
39
40
|
end
|
|
40
41
|
|
|
42
|
+
# Counts extra source lines consumed by backslash-continued
|
|
43
|
+
# multiline expressions in :output and :control nodes.
|
|
44
|
+
# Slim collapses these into one AST node whose ruby_code
|
|
45
|
+
# string retains the original newlines.
|
|
46
|
+
def continuation_newlines(sexp)
|
|
47
|
+
code = case sexp
|
|
48
|
+
in [:slim, :output, _, String => c, *] then c
|
|
49
|
+
in [:slim, :control, String => c, *] then c
|
|
50
|
+
else return 0
|
|
51
|
+
end
|
|
52
|
+
code.count("\n")
|
|
53
|
+
end
|
|
54
|
+
|
|
41
55
|
def node?(sexp)
|
|
42
56
|
sexp.is_a?(Array) && !sexp.empty? && sexp[0].is_a?(Symbol)
|
|
43
57
|
end
|
data/lib/a11y/lint/version.rb
CHANGED