haml_lint 0.49.1 → 0.49.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/haml_lint/ruby_extraction/chunk_extractor.rb +8 -6
- data/lib/haml_lint/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95c5137a04c59dbfc74fbc6648be0e502ae683e7bca5ff756bab9daf128243cb
|
4
|
+
data.tar.gz: 4b7429295c1a07d73dd3fae058cafba55fdcab05a7113623a5db4d8aed4d7d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ab868d2be78c9a5fcebc8dd370687fa088deb4b537a64c3ff878e4a8bb4a057a9841c6b0f02914a9ebd791bf19a19e737d9f559e8b12f577c215695ff9b207d
|
7
|
+
data.tar.gz: dbd373708eba214749fc1aa20e42d330c494ac1e3161a71527c956f405e845fb724d312dfa4bfae1bc3c080fe2d972fb75cf9915e1a1c0a808ba4b1ca963be15
|
@@ -394,7 +394,7 @@ module HamlLint::RubyExtraction
|
|
394
394
|
|
395
395
|
# Adds chunks for the interpolation within the given code
|
396
396
|
def add_interpolation_chunks(node, code, haml_line_index, indent:, line_start_index: 0)
|
397
|
-
HamlLint::Utils.handle_interpolation_with_indexes(code) do |scanner, line_index,
|
397
|
+
HamlLint::Utils.handle_interpolation_with_indexes(code) do |scanner, line_index, line_char_index|
|
398
398
|
escapes = scanner[2].size
|
399
399
|
next if escapes.odd?
|
400
400
|
char = scanner[3] # '{', '@' or '$'
|
@@ -403,14 +403,16 @@ module HamlLint::RubyExtraction
|
|
403
403
|
next
|
404
404
|
end
|
405
405
|
|
406
|
-
|
407
|
-
|
406
|
+
line_start_char_index = line_char_index
|
407
|
+
line_start_char_index += line_start_index if line_index == 0
|
408
|
+
code_start_char_index = scanner.charpos
|
408
409
|
|
409
|
-
|
410
|
+
# This moves the scanner
|
411
|
+
Haml::Util.balance(scanner, '{', '}', 1)
|
410
412
|
|
411
413
|
# Need to manually get the code now that we have positions so that all whitespace is present,
|
412
414
|
# because Haml::Util.balance does a strip...
|
413
|
-
interpolated_code = code[
|
415
|
+
interpolated_code = code[code_start_char_index...scanner.charpos - 1]
|
414
416
|
|
415
417
|
if interpolated_code.include?("\n")
|
416
418
|
# We can't correct multiline interpolation.
|
@@ -430,7 +432,7 @@ module HamlLint::RubyExtraction
|
|
430
432
|
interpolated_code = "#{' ' * indent}#{script_output_prefix}#{interpolated_code}"
|
431
433
|
@ruby_chunks << InterpolationChunk.new(node, [interpolated_code],
|
432
434
|
haml_line_index: haml_line_index + line_index,
|
433
|
-
start_char_index:
|
435
|
+
start_char_index: line_start_char_index,
|
434
436
|
end_marker_indent: indent)
|
435
437
|
end
|
436
438
|
end
|
data/lib/haml_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.49.
|
4
|
+
version: 0.49.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: haml
|