slim-embedded-minify 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/slim/embedded/minify/tag.rb +11 -6
- data/lib/slim/embedded/minify/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: f18ed0ba3778ee7349be7c14d9d3974077bff29611ecd20eddab983394b38eb3
|
4
|
+
data.tar.gz: 9956d7da18d3074e0b9209491db3a057c85fb015823b231d7db11a7c1bbb1c22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9da11747c1bbe17719d9e7844d5f846a0eb28182c64f285dddf6f61fee5330cac386a33c490397ff770c205b38e7895e59961070f9b3110617c9321c539a193
|
7
|
+
data.tar.gz: c0b7c531155113b1d118212976dbd60bdd6ed887bca10939ab18c5f881ee98a599cfe329f3bdd6adda8c3a1161403b7cce7cd69a5972de92a44e859b89885cf8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 0.2.4 - 2023-07-27
|
4
|
+
|
5
|
+
- Fix deletion of strings when `/*` is present in the string
|
6
|
+
|
7
|
+
## 0.2.3 - 2023-07-27
|
8
|
+
|
9
|
+
- Fix to not removing line when a block comment if it starts at the end of a line.
|
10
|
+
|
11
|
+
## 0.2.2 - 2023-07-20
|
12
|
+
|
3
13
|
- Fix an invalid remove comment.
|
4
14
|
|
5
15
|
## 0.2.1 - 2023-07-18
|
@@ -21,15 +21,16 @@ module Slim
|
|
21
21
|
stripped_quotes = stripped_quotes(line)
|
22
22
|
if stripped_quotes.match?(%r{/\*})
|
23
23
|
multiline_comment = true
|
24
|
-
|
24
|
+
line.last.sub!(/(?<!['"])\/\*.*$/, '')
|
25
25
|
elsif multiline_comment
|
26
|
-
|
27
|
-
|
26
|
+
next unless stripped_quotes.match?(%r{\*/})
|
27
|
+
|
28
|
+
multiline_comment = false
|
29
|
+
line.last.sub!(/.*\*\/(?<!['"])/, '')
|
28
30
|
end
|
29
|
-
line
|
30
|
-
else
|
31
|
-
line
|
31
|
+
next if empty_line?(line)
|
32
32
|
end
|
33
|
+
line
|
33
34
|
end.compact
|
34
35
|
end
|
35
36
|
|
@@ -46,6 +47,10 @@ module Slim
|
|
46
47
|
def stripped_quotes(line)
|
47
48
|
line.last.gsub(/(['"]).*?\1/, '')
|
48
49
|
end
|
50
|
+
|
51
|
+
def empty_line?(line)
|
52
|
+
line.last.gsub(/[\n\s]/, '').empty?
|
53
|
+
end
|
49
54
|
end
|
50
55
|
end
|
51
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slim-embedded-minify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yudai Takada
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slim
|