bootstrap-email 1.0.1 → 1.0.2

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: b3a9b2ebe28846362e698e13641ff407acd7419fa1cf578bf52702b616f80c1f
4
- data.tar.gz: d87d15ba04e2f789be9ab51577ff17ff9ae2cd2f9b8fbe6ab0e8ad1515de870c
3
+ metadata.gz: 3fd77db91c7a64e16baf699225f9187894bd92bd87a8c23584c8435e520e8042
4
+ data.tar.gz: 00f9c70ad47a3cafbd4c9663e2932e9efa8b1fc8706e3971a8bf27bc80f0ee93
5
5
  SHA512:
6
- metadata.gz: a73433c6c50b383c3892b53277c7f97e083ace4edac30563e138c95e878bf86928748246ebc6212e93b606ce1df15dd1c3d9320deb238e42ecff68235c30e3a2
7
- data.tar.gz: eaf6bf4300bde849a713d4842784d8cd906ca2d256db0b548a99dfb5ce02a0da7384bd1aeff961b7a013dc928f5c886579edd4d43851a4b0c302e0d70b32ffe4
6
+ metadata.gz: ccc640cbc412e925b1dbf37925ad09b3c6f8e9633dd091fc73e2daa578536401f98938743bb25dbfb21999f5d14e5a63056d23d9fad3f981fc44a25a5b1214d2
7
+ data.tar.gz: 10e8d04cbc16099c20b1193f52cd17b704bcddda74b15e78dabb0ebcd36ebf059b89dd8cc97021a7a451e89b90f6ae80aaaa1f5d018bc33be86c4b0c65ac25f8
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -90,7 +90,8 @@ module BootstrapEmail
90
90
 
91
91
  def finalize_document!
92
92
  html = doc.to_html(encoding: 'US-ASCII')
93
- html = BootstrapEmail::Converter::ForceEncoding.replace(html)
93
+ BootstrapEmail::Converter::SupportUrlTokens.replace(html)
94
+ BootstrapEmail::Converter::ForceEncoding.replace(html)
94
95
  case type
95
96
  when :rails
96
97
  (@mail.html_part || @mail).body = html
@@ -4,7 +4,7 @@ module BootstrapEmail
4
4
  def self.replace(html)
5
5
  # force utf-8 character encoded in iOS Mail: https://github.com/bootstrap-email/bootstrap-email/issues/50
6
6
  # this needs to be done after the document has been outputted to a ascii string so it doesn't get converted
7
- html.sub(
7
+ html.sub!(
8
8
  '<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">',
9
9
  '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
10
10
  )
@@ -0,0 +1,17 @@
1
+ module BootstrapEmail
2
+ module Converter
3
+ class SupportUrlTokens < Base
4
+ OPEN_BRACKETS = CGI.escape('{{').freeze
5
+ CLOSE_BRACKETS = CGI.escape('}}').freeze
6
+
7
+ def self.replace(html)
8
+ regex = /((href|src)=(\"|\'))((#{Regexp.quote(OPEN_BRACKETS)}).*?(#{Regexp.quote(CLOSE_BRACKETS)}))(\"|\')/
9
+ if regex.match?(html)
10
+ html.gsub!(regex) do |match|
11
+ "#{$1}#{CGI.unescape($4)}#{$7}"
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ 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.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Yamartino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-17 00:00:00.000000000 Z
11
+ date: 2021-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -126,6 +126,7 @@ files:
126
126
  - lib/bootstrap-email/converters/spacer.rb
127
127
  - lib/bootstrap-email/converters/spacing.rb
128
128
  - lib/bootstrap-email/converters/stack.rb
129
+ - lib/bootstrap-email/converters/support_url_tokens.rb
129
130
  - lib/bootstrap-email/converters/table.rb
130
131
  - lib/bootstrap-email/converters/version_comment.rb
131
132
  - lib/bootstrap-email/erb.rb
@@ -156,7 +157,7 @@ requirements: []
156
157
  rubygems_version: 3.0.3
157
158
  signing_key:
158
159
  specification_version: 4
159
- summary: 'Bootstrap 5 stylesheet, compiler, and inliner for responsive and consistent
160
+ summary: 'Bootstrap 5+ stylesheet, compiler, and inliner for responsive and consistent
160
161
  emails with the Bootstrap syntax you know and love. Support: command line, ruby,
161
162
  rails'
162
163
  test_files: []