-
Notifications
You must be signed in to change notification settings - Fork 979
Description
Describe the bug
When using <mj-style inline="inline">
all html elements inside <mj-raw>
and <mj-table>
have their tag names and parameters set to lowercase, even if they aren't related to the css selectors.
My intended workflow is using MJML to render a freemarker template, which our application can process to dynamically generate unique emails. The freemarker tags include references to variables, so casing is important.
To Reproduce
Steps to reproduce the behavior:
- Render the following MJML using the cli application, or the try-it-live editor:
<mjml>
<mj-head>
<mj-style inline="inline">
.myClass{
background: red;
}
</mj-style>
</mj-head>
<mj-body>
<mj-raw>
<#if someCheckHere()>
<p class="myClass">${someValueHere}</p>
</#if>
</mj-raw>
</mj-body>
</mjml>
Expected behavior
Body output is:
<body>
<div style="">
<#if someCheckHere()>
<p class="myClass" style="background: red;>${someValueHere}</p>
</#if>
</div>
</body>
Ideally, the styles would be inlined with the <p>
tag and the unrelated <#if>
would remain unchanged. Or, since it's inside an mj-raw tag, everything including the <p>
would remain untouched.
Actual behavior
Body output is:
<body>
<div style="">
<#if somecheckhere()="">
<p class="myClass" style="background: red;">${someValueHere}</p>
</#if>
</div>
</body>
The style is applied, but the <#if>
tag's attribute somecheckhere
is lowercased
MJML environment (please complete the following information):
- MacOS Mojave
- mjml-core: 4.2.1
- mjml-cli: 4.2.1