-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mj-raw incorrectly omits closing tag #319
Comments
Yeah, the implemented html renderer will write a closing element if there is no children. I understand that it's not consistent in term of html but in term of visual, it should stay the same. If you have another point of view about it, feel free to share it with me, I'd be happy to reconsider my choice 😉 |
Chrome (and Safari, I guess WebKit, haven't tried Firefox) disagrees on the visual side 😄 (sorry I should have added this to the original ticket) Here is the HTML that Chrome constructs when rendering the HTML generated by mrml from the above snippet: <body style="word-spacing:normal;">
<div>
<!--[if mso | IE]><table align="center" cellpadding="0" width="600" border="0" role="presentation" cellspacing="0" style="width:600px;"><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->
<div style="margin:0px auto;max-width:600px;">
<table cellspacing="0" align="center" role="presentation" cellpadding="0" border="0" style="width:100%;">
<tbody>
<tr>
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;">
<!--[if mso | IE]><table border="0" cellpadding="0" role="presentation" cellspacing="0"><![endif]--><!--[if mso | IE]><tr><![endif]--><!--[if mso | IE]><td><![endif]-->
<script
src="http://example.com/hello.js"><!--[if mso | IE]></td><![endif]--> <!--[if mso | IE]><td style="vertical-align:top;width:300px;"><![endif]-->
<div class="mj-outlook-group-fix mj-column-per-50"
style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table cellspacing="0" role="presentation" width="100%" border="0" cellpadding="0"
style="vertical-align:top;">
<tbody>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div
style="font-family:Ubuntu, Helvetica, Arial, sans-serif;font-size:13px;line-height:1;text-align:left;color:#000000;">
Hello World!
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!--[if mso | IE]></td><![endif]-- >< !--[if mso | IE]></tr >< ![endif]-- >< !--[if mso | IE]></table >< ![endif]-- >
</td >
</tr >
</tbody >
</table >
</div >< !--[if mso | IE]></td ></tr ></table >< ![endif]-- >
</div >
</body >
</html >
</script>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body> The browser tries to close the script tag, but in doing so captures the rest of the content. The html generated by mrml therefore renders as a blank page instead of showing "Hello World". |
interesting! I will move that up then. |
mjml.io output fragment:
mrml output fragment
The documentation states that for script tags:
This can be worked around by using inline documentation for external scripts:
which causes the end tag to remain when rendering using mrml. This is however inconsistent with the behaviour of mjml.io.
(Before someone tells me not to include script tags in emails, I'm not! 😄 But I am displaying rendered content in a browser, where I use script tags)
The text was updated successfully, but these errors were encountered: