sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
296 stars 64 forks source link

mjml-rails seems to be incompatible with mjml 4.7.0 #65

Closed bjliu closed 2 years ago

bjliu commented 3 years ago

Recently, MJML released a new version, 4.7.0.

mjml-rails was working fine for us until that point, but after the update, this line began to throw some errors (in a file called _header.html.mjml).

%mj-column{"width" => "70%"}

MJML for some reason doesn't recognize the % unit and adds px, causing failures.

Failure/Error: %mjml

ActionView::Template::Error:
  Line 43 of /tmp/in20200921-1055-tu28bu.mjml (mj-column) — Attribute width has invalid value: 70%px for type Unit, only accepts (px, %) units and 1 value(s)
------------------
--- Caused by: ---
Mjml::Parser::ParseError:
  Line 43 of /tmp/in20200921-1055-tu28bu.mjml (mj-column) — Attribute width has invalid value: 70%px for type Unit, only accepts (px, %) units and 1 value(s)

Could anyone give any direction as to why this may be an issue?

sighmon commented 3 years ago

@bjliu Have you tried validating your templates via the CLI to check if its a bug in this gem or with mjml itself?

mjml --validate template.mjml