You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project I was using MRML to parse a complex mjml template, but I obtained every time the error
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/mjml_test`
thread 'main' panicked at src/main.rs:10:38:
parse template: UnexpectedToken(Span { start: 25, end: 45 })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
After some trial and error I found out that when I have a HTML comment like <!-- things --> anywhere inside the <mj-head> block the parser fails with UnexpectedToken targeted exactly at the comment.
The example template I used to have the previous error:
<mjml>
<mj-head>
<!-- TODO things -->
<mj-preview>
</mj-preview>
</mj-head>
<mj-body>
<mj-section>
<mj-column>
<mj-imagewidth="100px"src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"></mj-image>
<mj-dividerborder-color="#F45E43"></mj-divider>
<mj-textfont-size="20px"color="#F45E43"font-family="helvetica">Hello Test World</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>
The parser crashes even if the comment is inside <mj-preview> but not if it's inside <mj-body>
Edit: I'm using MJML version 2.1.1 but I've found the problem is present on the last version 3.0.1 too
The text was updated successfully, but these errors were encountered:
In my project I was using MRML to parse a complex mjml template, but I obtained every time the error
After some trial and error I found out that when I have a HTML comment like
<!-- things -->
anywhere inside the<mj-head>
block the parser fails with UnexpectedToken targeted exactly at the comment.The example template I used to have the previous error:
The parser crashes even if the comment is inside
<mj-preview>
but not if it's inside<mj-body>
Edit: I'm using MJML version 2.1.1 but I've found the problem is present on the last version 3.0.1 too
The text was updated successfully, but these errors were encountered: