mjml-rb 0.2.34 → 0.2.35
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/Gemfile +2 -0
- data/README.md +1 -1
- data/lib/mjml-rb/renderer.rb +10 -3
- data/lib/mjml-rb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9c0aec079dca1d68d66f5530f699398aa09703219b750945dde850c519f20de
|
|
4
|
+
data.tar.gz: ef9c027b625aa1e5f6000ec8f574472f8f38590e7013812be64d7b469f138e94
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c41b2a470fad579dc02b752577625b8008d04f00ae24404242eb846f24b02fadd2bd8154474fbe1336d707819253b705326a59d97af7047d4b99d8af8d2b7b73
|
|
7
|
+
data.tar.gz: f2ee9e775a83778c2ee2712505956bc2515198f5bc886aea0c4137844d24b2cd3782b7a38a4c42826c34c86d214f4e8105dcdfc5a8fcdcae85d9d7cf42ce8a7d
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -46,4 +46,4 @@ bundle exec bin/mjml --migrate old.mjml -s
|
|
|
46
46
|
> MJML templates the same way you render ERB — no extra runtime, no
|
|
47
47
|
> `package.json`, no `node_modules`.
|
|
48
48
|
|
|
49
|
-
Remaining parity work is tracked in [
|
|
49
|
+
Remaining parity work is tracked in [npm ↔ Ruby Parity Audit](/docs/PARITY_AUDIT.md).
|
data/lib/mjml-rb/renderer.rb
CHANGED
|
@@ -27,7 +27,11 @@ module MjmlRb
|
|
|
27
27
|
HTML_VOID_TAGS = %w[area base br col embed hr img input link meta param source track wbr].freeze
|
|
28
28
|
|
|
29
29
|
DEFAULT_FONTS = {
|
|
30
|
-
"
|
|
30
|
+
"Open Sans" => "https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700",
|
|
31
|
+
"Droid Sans" => "https://fonts.googleapis.com/css?family=Droid+Sans:300,400,500,700",
|
|
32
|
+
"Lato" => "https://fonts.googleapis.com/css?family=Lato:300,400,500,700",
|
|
33
|
+
"Roboto" => "https://fonts.googleapis.com/css?family=Roboto:300,400,500,700",
|
|
34
|
+
"Ubuntu" => "https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700"
|
|
31
35
|
}.freeze
|
|
32
36
|
|
|
33
37
|
DOCUMENT_RESET_CSS = <<~CSS.freeze
|
|
@@ -114,7 +118,7 @@ module MjmlRb
|
|
|
114
118
|
media_queries_tags = build_media_queries_tags(context[:breakpoint], context[:column_widths])
|
|
115
119
|
component_styles_tag = build_style_tag(unique_strings(context[:component_head_styles]))
|
|
116
120
|
user_styles_tag = build_style_tag(unique_strings(context[:user_styles]))
|
|
117
|
-
preview_block = preview.empty? ? "" : %(<div style="display:none;max-height:
|
|
121
|
+
preview_block = preview.empty? ? "" : %(<div style="display:none;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;">#{escape_html(preview)}</div>)
|
|
118
122
|
html_attributes = {
|
|
119
123
|
"lang" => context[:lang],
|
|
120
124
|
"dir" => context[:dir],
|
|
@@ -122,7 +126,10 @@ module MjmlRb
|
|
|
122
126
|
"xmlns:v" => "urn:schemas-microsoft-com:vml",
|
|
123
127
|
"xmlns:o" => "urn:schemas-microsoft-com:office:office"
|
|
124
128
|
}
|
|
125
|
-
body_style = style_join(
|
|
129
|
+
body_style = style_join(
|
|
130
|
+
"word-spacing" => "normal",
|
|
131
|
+
"background-color" => context[:background_color]
|
|
132
|
+
)
|
|
126
133
|
|
|
127
134
|
html = <<~HTML
|
|
128
135
|
<!doctype html>
|
data/lib/mjml-rb/version.rb
CHANGED