premailer 1.17.0 → 1.19.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: 6e81cf33d2027d02e79ecb94b7a535a54b45d0f62170195baecc51e150fdc4e8
|
4
|
+
data.tar.gz: ef4b18d2837a8a80565da581d4ad075115c2457ff2087cff1757c099d4a5724d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15a9659bb308546d7617c8bb09d79cf9d140e0773111309f078958f4b27c7964b331c78787bda3abb221d2b0561de0ba31a2eb007c853bd41d14f8ca1f4791a5
|
7
|
+
data.tar.gz: dc8ac1a09294cdbfa440445f5a6558d5d33d20ead9aa5026c4c83fec487d46aa1cab339abd8c8a15ac51871615a6e4ddcec505b5ddf7ba0436bfdff3cfbb5491
|
@@ -63,8 +63,12 @@ class Premailer
|
|
63
63
|
|
64
64
|
declarations = []
|
65
65
|
style.scan(/\[SPEC\=([\d]+)\[(.[^\]\]]*)\]\]/).each do |declaration|
|
66
|
-
|
67
|
-
|
66
|
+
begin
|
67
|
+
rs = CssParser::RuleSet.new(nil, declaration[1].to_s, declaration[0].to_i)
|
68
|
+
declarations << rs
|
69
|
+
rescue ArgumentError => e
|
70
|
+
raise e if @options[:rule_set_exceptions]
|
71
|
+
end
|
68
72
|
end
|
69
73
|
|
70
74
|
# Perform style folding
|
@@ -233,14 +237,7 @@ class Premailer
|
|
233
237
|
thing.gsub! entity, replacement
|
234
238
|
end
|
235
239
|
end
|
236
|
-
|
237
|
-
# However, we really don't want to hardcode this. ASCII-8BIT should be the default, but not the only option.
|
238
|
-
encoding = if thing.is_a?(String) and RUBY_VERSION =~ /1.9/
|
239
|
-
thing = thing.force_encoding(@options[:input_encoding]).encode!
|
240
|
-
@options[:input_encoding]
|
241
|
-
else
|
242
|
-
@options[:input_encoding] || (RUBY_PLATFORM == 'java' ? nil : 'BINARY')
|
243
|
-
end
|
240
|
+
encoding = @options[:input_encoding] || (RUBY_PLATFORM == 'java' ? nil : 'BINARY')
|
244
241
|
doc = if @options[:html_fragment]
|
245
242
|
::Nokogiri::HTML.fragment(thing, encoding)
|
246
243
|
else
|
@@ -237,14 +237,7 @@ class Premailer
|
|
237
237
|
thing.gsub! entity, replacement
|
238
238
|
end
|
239
239
|
end
|
240
|
-
|
241
|
-
# However, we really don't want to hardcode this. ASCII-8BIT should be the default, but not the only option.
|
242
|
-
encoding = if thing.is_a?(String) and RUBY_VERSION =~ /1.9/
|
243
|
-
thing = thing.force_encoding(@options[:input_encoding]).encode!
|
244
|
-
@options[:input_encoding]
|
245
|
-
else
|
246
|
-
@options[:input_encoding] || (RUBY_PLATFORM == 'java' ? nil : 'BINARY')
|
247
|
-
end
|
240
|
+
encoding = @options[:input_encoding] || (RUBY_PLATFORM == 'java' ? nil : 'BINARY')
|
248
241
|
doc = if @options[:html_fragment]
|
249
242
|
::Nokogiri::HTML.fragment(thing, encoding)
|
250
243
|
else
|
@@ -231,11 +231,6 @@ class Premailer
|
|
231
231
|
thing.gsub! entity, replacement
|
232
232
|
end
|
233
233
|
end
|
234
|
-
# Default encoding is ASCII-8BIT (binary) per http://groups.google.com/group/nokogiri-talk/msg/0b81ef0dc180dc74
|
235
|
-
# However, we really don't want to hardcode this. ASCII-8BIT should be the default, but not the only option.
|
236
|
-
if thing.is_a?(String) and RUBY_VERSION =~ /1.9/
|
237
|
-
thing = thing.force_encoding(@options[:input_encoding]).encode!
|
238
|
-
end
|
239
234
|
doc = if @options[:html_fragment]
|
240
235
|
::Nokogiri::HTML5.fragment(thing)
|
241
236
|
else
|
data/lib/premailer/premailer.rb
CHANGED
@@ -507,7 +507,8 @@ public
|
|
507
507
|
|
508
508
|
# Check <tt>CLIENT_SUPPORT_FILE</tt> for any CSS warnings
|
509
509
|
def check_client_support # :nodoc:
|
510
|
-
|
510
|
+
kwargs = Psych::VERSION >= '4' ? { aliases: true } : {}
|
511
|
+
@client_support ||= Psych.load(File.open(CLIENT_SUPPORT_FILE), **kwargs)
|
511
512
|
|
512
513
|
warnings = []
|
513
514
|
properties = []
|
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.19.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:
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: css_parser
|