Mjml: `<mj-raw>` contents must be in a new line to be output unmodified

Created on 25 Sep 2018  路  5Comments  路  Source: mjmlio/mjml

The following snippet will only output the second <?php endif ?>

<mj-raw><?php endif ?></mj-raw>
  <mj-raw>
  <?php endif ?>
</mj-raw>

Verifiable on try-it-live

Expected behavior:

<mj-raw> contents should be output, untouched, even if the opening tag, content and closing tag are on the same line.

Observed behavior:

<mj-raw> contents may be parsed/modified if the tags and content are on the same line

MJML version:

mjml-core: 4.1.2
mjml-cli: 4.1.2
Current mjml try-it-live

Bug Parser

Most helpful comment

Looks like we've found a fix about this, so let's hope it will be fixed in 4.3 馃憤

All 5 comments

Thanks for reporting this, we'll take a look at it.
Parser issues are quite hard to fix, so we're not expecting to have a quick fix for now, sorry about that

Yes that's a whole can of worms I suppose, but as the workaround is quite easy (putting mj-raw content on a newline), the issue is less impacting.

Maybe it could be useful in the component documentation to either point to this issue or explain the workaround there.

Looks like we've found a fix about this, so let's hope it will be fixed in 4.3 馃憤

Hi @gileri, we included the fix for this in the new 4.3 release, feel free to try it out !

It works fine in 4.3.1, thank you !

Was this page helpful?
0 / 5 - 0 ratings