bootstrap-email 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7da7e0b649969d555aa28a146b4dacbae0e92cfb5583cf3a21605cf95a0f6864
|
4
|
+
data.tar.gz: 31483dce9db95acafaed1893f5cc16dd483143dc7400929ba3752fc5b39d5c03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16f28e567dc36b6c34e304e9726d24606a01780b033a1d78d843b8e0d5112507e0902ecc95f9a379ebc390c6c4007894173bb307e662d56ad0c1f72c2895015d
|
7
|
+
data.tar.gz: e7e93ae7273e656d958bad0869f3fe951384f073156c3832277c65539d0d568ebc53dd3c97bbd6acf5e0367ab00eb71a2bf384a4789bee37e66a9ee2710f69f9
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.1
|
@@ -42,7 +42,7 @@ parser = OptionParser.new do |opts|
|
|
42
42
|
options[:config] = File.expand_path(v, Dir.pwd)
|
43
43
|
end
|
44
44
|
|
45
|
-
opts.on('-t', '--text', 'Return the plain text version of the email.') do |
|
45
|
+
opts.on('-t', '--text', 'Return the plain text version of the email.') do |_v|
|
46
46
|
options[:plain_text] = true
|
47
47
|
end
|
48
48
|
|
@@ -3,16 +3,14 @@
|
|
3
3
|
module BootstrapEmail
|
4
4
|
module Converter
|
5
5
|
class SupportUrlTokens < Base
|
6
|
-
OPEN_BRACKETS = CGI.escape('{{').freeze
|
7
|
-
|
8
|
-
CLOSE_BRACKETS = CGI.escape('}}').freeze
|
9
|
-
CLOSE_PERCENT = ('%' + CGI.escape('}')).freeze
|
6
|
+
OPEN_BRACKETS = [CGI.escape('{{'), '{{', "#{CGI.escape('{')}%", '{%'].freeze
|
7
|
+
CLOSE_BRACKETS = [CGI.escape('}}'), '}}', "%#{CGI.escape('}')}", '%}'].freeze
|
10
8
|
|
11
9
|
def self.replace(html)
|
12
|
-
regex = /((href|src)=("|'))(.*?((#{
|
10
|
+
regex = /((href|src)=("|'))(.*?((#{opening_regex}).*?(#{closing_regex})).*?)("|')/
|
13
11
|
return unless regex.match?(html)
|
14
12
|
|
15
|
-
inner_regex = /((#{
|
13
|
+
inner_regex = /((#{opening_regex}).*?(#{closing_regex}))/
|
16
14
|
|
17
15
|
html.gsub!(regex) do |_match|
|
18
16
|
start_text = Regexp.last_match(1)
|
@@ -24,6 +22,14 @@ module BootstrapEmail
|
|
24
22
|
"#{start_text}#{middle_text}#{end_text}"
|
25
23
|
end
|
26
24
|
end
|
25
|
+
|
26
|
+
def self.opening_regex
|
27
|
+
opening_regex = OPEN_BRACKETS.map { |bracket| Regexp.quote(bracket) }.join('|')
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.closing_regex
|
31
|
+
closing_regex = CLOSE_BRACKETS.map { |bracket| Regexp.quote(bracket) }.join('|')
|
32
|
+
end
|
27
33
|
end
|
28
34
|
end
|
29
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Yamartino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlbeautifier
|
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '0'
|
183
183
|
requirements: []
|
184
|
-
rubygems_version: 3.
|
184
|
+
rubygems_version: 3.1.6
|
185
185
|
signing_key:
|
186
186
|
specification_version: 4
|
187
187
|
summary: 'Bootstrap 5+ stylesheet, compiler, and inliner for responsive and consistent
|