css_parser 1.15.0 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/css_parser/parser.rb +11 -2
- data/lib/css_parser/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: 36f35091b57e726d3e9b528b6f3357232343c075af962f61a402f2bb111aadd1
|
4
|
+
data.tar.gz: ee8dbf61a3a6f396e8d383f0334cfee91ad483b192bfbffb4e5c5d9294f89859
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba19471cdbeed2daf719a2e1b238bff145bd748abbc760b64cd5ba40ba3e0ed03de8f6550b44b114bcbdbd577cd415b8f5c609def6c53a25699d3ca71f6e06d7
|
7
|
+
data.tar.gz: 72d71760da086f403c0d404c97d6bd6476e330376b56ce91b8ebfc51cdd27fc89932a066397b38799c15fb9f9a8a8b625d30728656dc0e8cfc24ec61a168e8e7
|
data/lib/css_parser/parser.rb
CHANGED
@@ -329,7 +329,7 @@ module CssParser
|
|
329
329
|
rule_start = nil
|
330
330
|
offset = nil
|
331
331
|
|
332
|
-
block.scan(/\s+|\\{2,}|\\?[{}\s"]|.[^\s"{}\\]*/) do |token|
|
332
|
+
block.scan(/\s+|\\{2,}|\\?[{}\s"]|[()]|.[^\s"{}()\\]*/) do |token|
|
333
333
|
# save the regex offset so that we know where in the file we are
|
334
334
|
offset = Regexp.last_match.offset(0) if options[:capture_offsets]
|
335
335
|
|
@@ -391,7 +391,16 @@ module CssParser
|
|
391
391
|
current_media_query = String.new
|
392
392
|
else
|
393
393
|
token.strip!
|
394
|
-
|
394
|
+
# special-case the ( and ) tokens to remove inner-whitespace
|
395
|
+
# (eg we'd prefer '(width: 500px)' to '( width: 500px )' )
|
396
|
+
case token
|
397
|
+
when '('
|
398
|
+
current_media_query << token
|
399
|
+
when ')'
|
400
|
+
current_media_query.sub!(/ ?$/, token)
|
401
|
+
else
|
402
|
+
current_media_query << token << ' '
|
403
|
+
end
|
395
404
|
end
|
396
405
|
elsif in_charset or token =~ /@charset/i
|
397
406
|
# iterate until we are out of the charset declaration
|
data/lib/css_parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: css_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Dunae
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|