maizzle/maizzle-php

If processConditionalComments is enabled, it removes closing tags within comments

JJCLane opened this issue · 1 comments

Given this short example <!--[if mso]><center><![endif]--> in the final production output the comment is kept in tact as expected. However, if you change it to a closing tag <!--[if mso]></center><![endif]--> like is required to correctly close the center tag in outlook, the output becomes: <!--[if mso]><![endif]-->.

This same issue affects any closing tag like the examples provided in vmlbg, <!--[if mso]></div></v:rect><![endif]--> so cause rendering issues with the emails in Outlook.

Doing a bit of investigation I tracked it down to processConditionalComments, which is using html-minifier. There was already a couple of issues raised there about this and the author states it only supports valid fragments and it looks like that won't change. My suggestion is that the option should be false by default to stop other people facing this pretty obscure bug.

You’re absolutely right, not sure why I set that to true in the production config...

Come to think about it, this minifier option shouldn’t even be exposed in the Maizzle config. I’ll work on a fix that will remove the option from the config and leave it hardcoded as false in the html-minifier call.

Thanks for pointing it out!