premailer 1.25.0 → 1.26.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e50487681c955ef37736d8db83842cf9578b1f37eac290d77eded552410a92f
|
4
|
+
data.tar.gz: 9fd8a34f3dc6e7c4c2b68cff6d6d1e3137f615e61814b72c2b47b39785f60be6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdfc41db2e437d4d713cf9698e6356626bd4ef1f646bb0aa57c05ca2685f7a79340a2ffeef4e0d85468d55e933e15b6862f8ee01bda497d21d81f31e7826337a
|
7
|
+
data.tar.gz: f98c2f0b2318b547f9f506f136702ebcef4132652455eb9c2f3f7e03ffa1f9d201f1b97779c39c540881d4b86fedc147732441da7cf39997233eaa873d5006b9
|
@@ -29,13 +29,13 @@ class Premailer
|
|
29
29
|
selector.gsub!(/([\s]|^)([\w]+)/) { |m| $1.to_s + $2.to_s.downcase }
|
30
30
|
|
31
31
|
if Premailer.is_media_query?(media_types) || selector =~ Premailer::RE_UNMERGABLE_SELECTORS
|
32
|
-
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selector, declaration), media_types) unless @options[:preserve_styles]
|
32
|
+
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selectors: selector, block: declaration), media_types) unless @options[:preserve_styles]
|
33
33
|
else
|
34
34
|
begin
|
35
35
|
if Premailer::RE_RESET_SELECTORS.match?(selector)
|
36
36
|
# this is in place to preserve the MailChimp CSS reset: http://github.com/mailchimp/Email-Blueprints/
|
37
37
|
# however, this doesn't mean for testing pur
|
38
|
-
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selector, declaration)) unless !@options[:preserve_reset]
|
38
|
+
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selectors: selector, block: declaration)) unless !@options[:preserve_reset]
|
39
39
|
end
|
40
40
|
|
41
41
|
# Change single ID CSS selectors into xpath so that we can match more
|
@@ -64,7 +64,7 @@ class Premailer
|
|
64
64
|
style = el.attributes['style'].to_s
|
65
65
|
|
66
66
|
declarations = style.scan(/\[SPEC\=([\d]+)\[(.[^\]\]]*)\]\]/).filter_map do |declaration|
|
67
|
-
rs = Premailer::CachedRuleSet.new(
|
67
|
+
rs = Premailer::CachedRuleSet.new(block: declaration[1].to_s, specificity: declaration[0].to_i)
|
68
68
|
rs.expand_shorthand!
|
69
69
|
rs
|
70
70
|
rescue ArgumentError => e
|
@@ -35,13 +35,13 @@ class Premailer
|
|
35
35
|
selector.gsub!(/([\s]|^)([\w]+)/) { |m| $1.to_s + $2.to_s.downcase }
|
36
36
|
|
37
37
|
if Premailer.is_media_query?(media_types) || selector =~ Premailer::RE_UNMERGABLE_SELECTORS
|
38
|
-
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selector, declaration), media_types) unless @options[:preserve_styles]
|
38
|
+
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selectors: selector, block: declaration), media_types) unless @options[:preserve_styles]
|
39
39
|
else
|
40
40
|
begin
|
41
41
|
if Premailer::RE_RESET_SELECTORS.match?(selector)
|
42
42
|
# this is in place to preserve the MailChimp CSS reset: http://github.com/mailchimp/Email-Blueprints/
|
43
43
|
# however, this doesn't mean for testing pur
|
44
|
-
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selector, declaration)) unless !@options[:preserve_reset]
|
44
|
+
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selectors: selector, block: declaration)) unless !@options[:preserve_reset]
|
45
45
|
end
|
46
46
|
|
47
47
|
# Try the new index based technique. If not supported, fall back to the old brute force one.
|
@@ -70,7 +70,7 @@ class Premailer
|
|
70
70
|
declarations = []
|
71
71
|
style.scan(/\[SPEC\=([\d]+)\[(.[^\]\]]*)\]\]/).each do |declaration|
|
72
72
|
begin
|
73
|
-
rs = CssParser::RuleSet.new(
|
73
|
+
rs = CssParser::RuleSet.new(block: declaration[1].to_s, specificity: declaration[0].to_i)
|
74
74
|
declarations << rs
|
75
75
|
rescue ArgumentError => e
|
76
76
|
raise e if @options[:rule_set_exceptions]
|
@@ -27,13 +27,13 @@ class Premailer
|
|
27
27
|
selector.gsub!(/([\s]|^)([\w]+)/) { |m| $1.to_s + $2.to_s.downcase }
|
28
28
|
|
29
29
|
if Premailer.is_media_query?(media_types) || selector =~ Premailer::RE_UNMERGABLE_SELECTORS
|
30
|
-
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selector, declaration), media_types) unless @options[:preserve_styles]
|
30
|
+
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selectors: selector, block: declaration), media_types) unless @options[:preserve_styles]
|
31
31
|
else
|
32
32
|
begin
|
33
33
|
if Premailer::RE_RESET_SELECTORS.match?(selector)
|
34
34
|
# this is in place to preserve the MailChimp CSS reset: http://github.com/mailchimp/Email-Blueprints/
|
35
35
|
# however, this doesn't mean for testing pur
|
36
|
-
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selector, declaration)) unless !@options[:preserve_reset]
|
36
|
+
@unmergable_rules.add_rule_set!(CssParser::RuleSet.new(selectors: selector, block: declaration)) unless !@options[:preserve_reset]
|
37
37
|
end
|
38
38
|
|
39
39
|
# Change single ID CSS selectors into xpath so that we can match more
|
@@ -64,7 +64,7 @@ class Premailer
|
|
64
64
|
declarations = []
|
65
65
|
style.scan(/\[SPEC\=([\d]+)\[(.[^\]\]]*)\]\]/).each do |declaration|
|
66
66
|
begin
|
67
|
-
rs = CssParser::RuleSet.new(
|
67
|
+
rs = CssParser::RuleSet.new(block: declaration[1].to_s, specificity: declaration[0].to_i)
|
68
68
|
declarations << rs
|
69
69
|
rescue ArgumentError => e
|
70
70
|
raise e if @options[:rule_set_exceptions]
|
data/lib/premailer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: premailer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.26.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: 2024-08-
|
11
|
+
date: 2024-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: css_parser
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.19.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.19.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: htmlentities
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|