bootstrap-email 1.0.2 → 1.1.0
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 +4 -4
- data/VERSION +1 -1
- data/core/bootstrap-head.scss +1 -1
- data/core/layout.html.erb +1 -1
- data/lib/bootstrap-email/compiler.rb +2 -0
- data/lib/bootstrap-email/converters/add_missing_meta_tags.rb +21 -0
- data/lib/bootstrap-email/converters/base.rb +2 -1
- data/lib/bootstrap-email/converters/beautify_html.rb +10 -0
- data/lib/bootstrap-email.rb +1 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4197c0097c9360b43b8a1ede02394b097e5e2f40451d7e3adc47d3147a91f6e8
|
4
|
+
data.tar.gz: a79f895885f53be20db9647c21adf5265d7fa7ec95726a07ac3f44645f532f87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45e2bee1dd5e717b2c5487b215b2281309ce8e4e97d218382927e7450ae99e5512874e42cb6558bc37ec85378d201ad509139e4d200421225c2921ab466635e5
|
7
|
+
data.tar.gz: 67eaf18b7351c22cb4970a31c0f6e548f493eacba3e0fd6d3e18f8268ff949a8f70c81cc40f44dc1cc1053b7197b6dfdcdf457e66fe975b1a889f8aab7886a55
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/core/bootstrap-head.scss
CHANGED
data/core/layout.html.erb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
-
<meta name="x-apple-disable-message-reformatting">
|
6
5
|
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
6
|
+
<meta name="x-apple-disable-message-reformatting">
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
|
9
9
|
</head>
|
@@ -85,6 +85,7 @@ module BootstrapEmail
|
|
85
85
|
|
86
86
|
def configure_html!
|
87
87
|
BootstrapEmail::Converter::HeadStyle.build(doc)
|
88
|
+
BootstrapEmail::Converter::AddMissingMetaTags.build(doc)
|
88
89
|
BootstrapEmail::Converter::VersionComment.build(doc)
|
89
90
|
end
|
90
91
|
|
@@ -92,6 +93,7 @@ module BootstrapEmail
|
|
92
93
|
html = doc.to_html(encoding: 'US-ASCII')
|
93
94
|
BootstrapEmail::Converter::SupportUrlTokens.replace(html)
|
94
95
|
BootstrapEmail::Converter::ForceEncoding.replace(html)
|
96
|
+
BootstrapEmail::Converter::BeautifyHTML.replace(html)
|
95
97
|
case type
|
96
98
|
when :rails
|
97
99
|
(@mail.html_part || @mail).body = html
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module BootstrapEmail
|
2
|
+
module Converter
|
3
|
+
class AddMissingMetaTags < Base
|
4
|
+
META_TAGS = [
|
5
|
+
{query: 'meta[http-equiv="Content-Type"]' , code: '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'},
|
6
|
+
{query: 'meta[http-equiv="x-ua-compatible"]', code: '<meta http-equiv="x-ua-compatible" content="ie=edge">'},
|
7
|
+
{query: 'meta[name="x-apple-disable-message-reformatting"]', code: '<meta name="x-apple-disable-message-reformatting">'},
|
8
|
+
{query: 'meta[name="viewport"]', code: '<meta name="viewport" content="width=device-width, initial-scale=1">'},
|
9
|
+
{query: 'meta[name="format-detection"]', code: '<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">'}
|
10
|
+
].reverse.freeze
|
11
|
+
|
12
|
+
def build
|
13
|
+
META_TAGS.each do |tag_hash|
|
14
|
+
unless doc.at_css(tag_hash[:query])
|
15
|
+
doc.at_css('head').prepend_child(tag_hash[:code])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -36,7 +36,8 @@ module BootstrapEmail
|
|
36
36
|
|
37
37
|
def add_class(node, class_name)
|
38
38
|
node['class'] ||= ''
|
39
|
-
|
39
|
+
# remove double spaces and strip white space from ends
|
40
|
+
node['class'] = "#{node['class']} #{class_name}".gsub(/\s+/, ' ').strip
|
40
41
|
end
|
41
42
|
|
42
43
|
def margin?(node)
|
data/lib/bootstrap-email.rb
CHANGED
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
|
4
|
+
version: 1.1.0
|
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-10-
|
11
|
+
date: 2021-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: htmlbeautifier
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.3'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.3'
|
55
69
|
description:
|
56
70
|
email: stu@stuyam.com
|
57
71
|
executables:
|
@@ -105,10 +119,12 @@ files:
|
|
105
119
|
- lib/bootstrap-email/bootstrap_email_cli.rb
|
106
120
|
- lib/bootstrap-email/compiler.rb
|
107
121
|
- lib/bootstrap-email/config.rb
|
122
|
+
- lib/bootstrap-email/converters/add_missing_meta_tags.rb
|
108
123
|
- lib/bootstrap-email/converters/alert.rb
|
109
124
|
- lib/bootstrap-email/converters/align.rb
|
110
125
|
- lib/bootstrap-email/converters/badge.rb
|
111
126
|
- lib/bootstrap-email/converters/base.rb
|
127
|
+
- lib/bootstrap-email/converters/beautify_html.rb
|
112
128
|
- lib/bootstrap-email/converters/block.rb
|
113
129
|
- lib/bootstrap-email/converters/body.rb
|
114
130
|
- lib/bootstrap-email/converters/button.rb
|