premailer 1.15.0 → 1.17.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: 1cbcf7916881885f8da597bf060d93f4faa9a909051f3be3331d63c01b12d07f
4
- data.tar.gz: 9f507ecec471e66009960367a42ffb618a6f9769fa3bc59358c40e9c0e676bd8
3
+ metadata.gz: baac2fb34027342c72b3c9473f2afd01c42cc89c163a0062497acb951671649a
4
+ data.tar.gz: e6bcd9beb173528883ab58ba545ae34abd50aaefeea560907a92992a8832c2be
5
5
  SHA512:
6
- metadata.gz: 823f4d6c03aaa776cca778046154c5471312ffcd79296801f94b9cc8b06e5e5a5ca79e5a3f668b03e17fa72ec3419250388ce79c4ddf8cc800c6e9554b783b4b
7
- data.tar.gz: 43ce39e4a1bc35a4e275072c64ee806b7bb8a735b40eafd67dc2da95671a6299ec9c6df0e35e2d6db86158245b8c9db6815fb96573953a452d95097fa760abe7
6
+ metadata.gz: f1a5bab6f6bf4010fab0bdd5fb70dba2960598291a0537d522e80e8a05a98a5f4d79a77971b27fcd699acef379ce62e4ac87dd827720e16b6981d17d44da726c
7
+ data.tar.gz: '078e582d512367bcaa41458985eeb8cee1232101819d225c8b04bf9e143ed60426920ddbd42ad1e6df962f0699ec37b9bd7c56fa3c2dcf10fe05983c548b1719'
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Premailer README [![Build Status](https://travis-ci.org/premailer/premailer.svg?branch=master)](https://travis-ci.org/premailer/premailer) [![Gem Version](https://badge.fury.io/rb/premailer.svg)](https://badge.fury.io/rb/premailer)
1
+ # Premailer README [![CI](https://github.com/premailer/premailer/actions/workflows/actions.yml/badge.svg)](https://github.com/premailer/premailer/actions/workflows/actions.yml) [![Gem Version](https://badge.fury.io/rb/premailer.svg)](https://badge.fury.io/rb/premailer)
2
2
 
3
3
  ## What is this?
4
4
 
@@ -68,7 +68,7 @@ Premailer::Adapter.use = :nokogiri_fast
68
68
 
69
69
  ## Ruby Compatibility
70
70
 
71
- See .travis.yml for which ruby versions are tested. JRuby support is close, contributors are welcome. Checkout the latest build status on the [Travis CI dashboard](https://travis-ci.org/#!/premailer/premailer).
71
+ See .github/workflows/actions.yml for which ruby versions are tested. JRuby support is close, contributors are welcome.
72
72
 
73
73
  ## Premailer-specific CSS
74
74
 
@@ -125,13 +125,13 @@ class Premailer
125
125
  doc.search("a[@href^='#']").each do |el|
126
126
  target = el.get_attribute('href')[1..-1]
127
127
  targets << target
128
- el.set_attribute('href', "#" + Digest::MD5.hexdigest(target))
128
+ el.set_attribute('href', "#" + Digest::SHA256.hexdigest(target))
129
129
  end
130
130
  # hash ids that are links target, delete others
131
131
  doc.search("*[@id]").each do |el|
132
132
  id = el.get_attribute('id')
133
133
  if targets.include?(id)
134
- el.set_attribute('id', Digest::MD5.hexdigest(id))
134
+ el.set_attribute('id', Digest::SHA256.hexdigest(id))
135
135
  else
136
136
  el.remove_attribute('id')
137
137
  end
@@ -129,13 +129,13 @@ class Premailer
129
129
  doc.search("a[@href^='#']").each do |el|
130
130
  target = el.get_attribute('href')[1..-1]
131
131
  targets << target
132
- el.set_attribute('href', "#" + Digest::MD5.hexdigest(target))
132
+ el.set_attribute('href', "#" + Digest::SHA256.hexdigest(target))
133
133
  end
134
134
  # hash ids that are links target, delete others
135
135
  doc.search("*[@id]").each do |el|
136
136
  id = el.get_attribute('id')
137
137
  if targets.include?(id)
138
- el.set_attribute('id', Digest::MD5.hexdigest(id))
138
+ el.set_attribute('id', Digest::SHA256.hexdigest(id))
139
139
  else
140
140
  el.remove_attribute('id')
141
141
  end
@@ -1,5 +1,3 @@
1
- require 'nokogumbo'
2
-
3
1
  class Premailer
4
2
  module Adapter
5
3
  # Nokogiri adapter
@@ -125,13 +123,13 @@ class Premailer
125
123
  doc.search("a[@href^='#']").each do |el|
126
124
  target = el.get_attribute('href')[1..-1]
127
125
  targets << target
128
- el.set_attribute('href', "#" + Digest::MD5.hexdigest(target))
126
+ el.set_attribute('href', "#" + Digest::SHA256.hexdigest(target))
129
127
  end
130
128
  # hash ids that are links target, delete others
131
129
  doc.search("*[@id]").each do |el|
132
130
  id = el.get_attribute('id')
133
131
  if targets.include?(id)
134
- el.set_attribute('id', Digest::MD5.hexdigest(id))
132
+ el.set_attribute('id', Digest::SHA256.hexdigest(id))
135
133
  else
136
134
  el.remove_attribute('id')
137
135
  end
@@ -168,7 +168,8 @@ class Premailer
168
168
  # @option options [Boolean] :preserve_reset Whether to preserve styles associated with the MailChimp reset code. Default is true.
169
169
  # @option options [Boolean] :with_html_string Whether the html param should be treated as a raw string. Default is false.
170
170
  # @option options [Boolean] :verbose Whether to print errors and warnings to <tt>$stderr</tt>. Default is false.
171
- # @option options [Boolean] :io_exceptions Throws exceptions on I/O errors.
171
+ # @option options [Boolean] :io_exceptions Throws exceptions on I/O errors. Default is false.
172
+ # @option options [Boolean] :rule_set_exceptions Throws exceptions on invalid values in CSS Parser rule sets. Default is true.
172
173
  # @option options [Boolean] :include_link_tags Whether to include css from <tt>link rel=stylesheet</tt> tags. Default is true.
173
174
  # @option options [Boolean] :include_style_tags Whether to include css from <tt>style</tt> tags. Default is true.
174
175
  # @option options [String] :input_encoding Manually specify the source documents encoding. This is a good idea. Default is ASCII-8BIT.
@@ -200,6 +201,7 @@ class Premailer
200
201
  :verbose => false,
201
202
  :debug => false,
202
203
  :io_exceptions => false,
204
+ :rule_set_exceptions => true,
203
205
  :include_link_tags => true,
204
206
  :include_style_tags => true,
205
207
  :input_encoding => 'ASCII-8BIT',
@@ -233,7 +235,8 @@ class Premailer
233
235
  @css_parser = CssParser::Parser.new({
234
236
  :absolute_paths => true,
235
237
  :import => true,
236
- :io_exceptions => @options[:io_exceptions]
238
+ :io_exceptions => @options[:io_exceptions],
239
+ :rule_set_exceptions => @options[:rule_set_exceptions]
237
240
  })
238
241
 
239
242
  @adapter_class = Adapter.find @options[:adapter]
@@ -1,4 +1,4 @@
1
1
  class Premailer
2
2
  # Premailer version.
3
- VERSION = '1.15.0'.freeze
3
+ VERSION = '1.17.0'.freeze
4
4
  end
data/lib/premailer.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'yaml'
2
2
  require 'open-uri'
3
- require 'digest/md5'
3
+ require 'digest/sha2'
4
4
  require 'cgi'
5
5
  require 'addressable/uri'
6
6
  require 'css_parser'
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.15.0
4
+ version: 1.17.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: 2021-05-13 00:00:00.000000000 Z
11
+ date: 2022-09-17 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.6.0
19
+ version: 1.12.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.6.0
26
+ version: 1.12.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: htmlentities
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 1.8.2
95
+ version: '1.13'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 1.8.2
102
+ version: '1.13'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: redcarpet
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -156,20 +156,6 @@ dependencies:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
- - !ruby/object:Gem::Dependency
160
- name: nokogumbo
161
- requirement: !ruby/object:Gem::Requirement
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- version: '0'
166
- type: :development
167
- prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- requirements:
170
- - - ">="
171
- - !ruby/object:Gem::Version
172
- version: '0'
173
159
  - !ruby/object:Gem::Dependency
174
160
  name: bump
175
161
  requirement: !ruby/object:Gem::Requirement
@@ -219,14 +205,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
219
205
  requirements:
220
206
  - - ">="
221
207
  - !ruby/object:Gem::Version
222
- version: 2.5.0
208
+ version: 2.7.0
223
209
  required_rubygems_version: !ruby/object:Gem::Requirement
224
210
  requirements:
225
211
  - - ">="
226
212
  - !ruby/object:Gem::Version
227
213
  version: '0'
228
214
  requirements: []
229
- rubygems_version: 3.2.16
215
+ rubygems_version: 3.1.6
230
216
  signing_key:
231
217
  specification_version: 4
232
218
  summary: Preflight for HTML e-mail.