mjml-rb 0.2.23 → 0.2.24
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/lib/mjml-rb/parser.rb +7 -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: 4840c5584afa1ff603e996338a128d5808ae46742f084d03c0e34391259616f9
|
|
4
|
+
data.tar.gz: ef16089bc907e5e5f649e10adac5389b27a25c63f3ee20aea3cb28db0e78da82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d378634ab4a2905f65e3831292cb0b55ae22dca61a310bb4c6bf62e77610dfec609cd3d130324c99836a37fc61a34a64c0433fd80729ffcaa9073f528c8c1bee
|
|
7
|
+
data.tar.gz: ea309a490a424440393727cd6e022f4c7372449e6e4f22a7506e8593051b7544d3a96e4af87846fc2d38a472c03aa97fe13fcc9c2ddfb8761912138238dc8210
|
data/lib/mjml-rb/parser.rb
CHANGED
|
@@ -92,9 +92,13 @@ module MjmlRb
|
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
def normalize_html_void_tags(content)
|
|
95
|
-
#
|
|
96
|
-
#
|
|
97
|
-
content = content.gsub(
|
|
95
|
+
# Legacy mail templates sometimes emit invalid closing </br> tags.
|
|
96
|
+
# Browser-style recovery treats them as actual line breaks, so preserve that.
|
|
97
|
+
content = content.gsub(%r{</br\s*>}i, "<br />")
|
|
98
|
+
|
|
99
|
+
# Remove other closing tags for void elements (e.g. </hr>, </img>).
|
|
100
|
+
# These are invalid in both HTML and XML and HTML5 recovery drops them.
|
|
101
|
+
content = content.gsub(/<\/(#{(HTML_VOID_TAGS - ["br"]).join("|")})\s*>/i, "")
|
|
98
102
|
|
|
99
103
|
# Self-close opening void tags that aren't already self-closed.
|
|
100
104
|
pattern = /<(#{HTML_VOID_TAGS.join("|")})(\s[^<>]*?)?>/i
|
data/lib/mjml-rb/version.rb
CHANGED