From 9cc1cfb0546e814db66abd45b54a47b8f79253cf Mon Sep 17 00:00:00 2001 From: Simon Gareste Date: Tue, 28 Sep 2021 12:13:14 +0200 Subject: [PATCH] Update minify and validation_level to be v4 compliant MJML 4 completely reworked the command line arguments. Amongst others, minify and validation_level cannot be use the same way anymore. There are probably others that would need a change, though. --- lib/mjml/parser.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/mjml/parser.rb b/lib/mjml/parser.rb index a2bb958..71d7520 100644 --- a/lib/mjml/parser.rb +++ b/lib/mjml/parser.rb @@ -65,11 +65,19 @@ def cmd_options end def minify_output - '--min' if MJML::Config.minify_output + if MJML::Feature::version[:major] >= 4 + '--config.minify true' if MJML::Config.minify_output + else + '--min' if MJML::Config.minify_output + end end def validation_level - "--level=#{MJML::Config.validation_level}" if MJML::Feature.available?(:validation_level) + if MJML::Feature::version[:major] >= 4 + "--config.validationLevel #{MJML::Config.validation_level}" + else + "--level=#{MJML::Config.validation_level}" if MJML::Feature.available?(:validation_level) + end end def output_from_file