bootstrap-email 1.4.0 → 1.4.1

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: 04e71823407d63e303e4b0e02f8ba43ed5969a3b6156f4076de8953db61e9522
4
- data.tar.gz: 2e88e162a938d9a785ef315cfc450425ca29f8d7f2725f99a7e8b1dde3986ac4
3
+ metadata.gz: 7da7e0b649969d555aa28a146b4dacbae0e92cfb5583cf3a21605cf95a0f6864
4
+ data.tar.gz: 31483dce9db95acafaed1893f5cc16dd483143dc7400929ba3752fc5b39d5c03
5
5
  SHA512:
6
- metadata.gz: f049857967b4afb28a04651661013f858b9892c204bda978f1b52b02489ea9b3e1cedb24445301f32b7c02a2fb15f53572cbd049388f0b7cede467ac932f393b
7
- data.tar.gz: f9992f886d948d9f433c017202849a5895bce4c42d76759c9cac798240168b0a6dddddeed04d4c19cf402d760fd5f0ecf37431b836250471477fa10cb484f24c
6
+ metadata.gz: 16f28e567dc36b6c34e304e9726d24606a01780b033a1d78d843b8e0d5112507e0902ecc95f9a379ebc390c6c4007894173bb307e662d56ad0c1f72c2895015d
7
+ data.tar.gz: e7e93ae7273e656d958bad0869f3fe951384f073156c3832277c65539d0d568ebc53dd3c97bbd6acf5e0367ab00eb71a2bf384a4789bee37e66a9ee2710f69f9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.0
1
+ 1.4.1
@@ -45,7 +45,7 @@ $theme-colors: (
45
45
  $palette-colors: (
46
46
  "black": $black,
47
47
  "white": $white,
48
- "transparent": "transparent",
48
+ "transparent": transparent,
49
49
 
50
50
  "gray-100": $gray-100,
51
51
  "gray-200": $gray-200,
@@ -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 |v|
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
- OPEN_PERCENT = (CGI.escape('{') + '%').freeze
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)=("|'))(.*?((#{Regexp.quote(OPEN_BRACKETS)}|#{Regexp.quote(OPEN_PERCENT)}).*?(#{Regexp.quote(CLOSE_BRACKETS)}|#{Regexp.quote(CLOSE_PERCENT)})).*?)("|')/
10
+ regex = /((href|src)=("|'))(.*?((#{opening_regex}).*?(#{closing_regex})).*?)("|')/
13
11
  return unless regex.match?(html)
14
12
 
15
- inner_regex = /((#{Regexp.quote(OPEN_BRACKETS)}|#{Regexp.quote(OPEN_PERCENT)}).*?(#{Regexp.quote(CLOSE_BRACKETS)}|#{Regexp.quote(CLOSE_PERCENT)}))/
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.0
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-01-17 00:00:00.000000000 Z
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.2.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