mjml-rb 0.3.3 → 0.3.4
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/renderer.rb +8 -1
- 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: c87c74bfccdb5ffe347fba7099a9f17855e1c42446b1edd0d013dbfa08fe5c67
|
|
4
|
+
data.tar.gz: b18e8124ded52ecc49a7d43f00da55ff902068f3b1593d195aaecb95e042346f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0e4714a86a42c8270a6ec66a8b7d50bc21f54ea9d0aebb8cbf5424fac2af621de1ab8fa79d8b51cdc92954b615e8c66dd55e499593dec4861a65052b6c7eacab
|
|
7
|
+
data.tar.gz: 80f36f9bea2094a8a13b8bffea1b8b3c3f62b67bfefb44a540ecdc96b479dc50366f7ca182f5f601387f31e8dc44cebf6c9c60c0f8761dfa530ad27aca9e6419
|
data/lib/mjml-rb/renderer.rb
CHANGED
|
@@ -830,9 +830,16 @@ module MjmlRb
|
|
|
830
830
|
CGI.escapeHTML(value.to_s)
|
|
831
831
|
end
|
|
832
832
|
|
|
833
|
+
# HTML attributes that are meaningful even when empty.
|
|
834
|
+
# `alt=""` signals a decorative image to browsers, suppressing the
|
|
835
|
+
# broken-image placeholder icon.
|
|
836
|
+
KEEP_WHEN_EMPTY = Set.new(%w[alt]).freeze
|
|
837
|
+
|
|
833
838
|
def html_attrs(hash)
|
|
834
839
|
attrs = hash.each_with_object([]) do |(key, value), memo|
|
|
835
|
-
|
|
840
|
+
if value.nil? || value.to_s.empty?
|
|
841
|
+
next unless KEEP_WHEN_EMPTY.include?(key) && !value.nil?
|
|
842
|
+
end
|
|
836
843
|
memo << %(#{key}="#{escape_attr(value)}")
|
|
837
844
|
end
|
|
838
845
|
return "" if attrs.empty?
|
data/lib/mjml-rb/version.rb
CHANGED