premailer icon indicating copy to clipboard operation
premailer copied to clipboard

Premailer removes invalid CSS from style tag even w/ data-premailer="ignore" added

Open Sawtaytoes opened this issue 10 years ago • 0 comments

If I put special ExactTarget AMP script tags in the style tag (style="%%=v(@HelloWorld)=%%"), even if data-premailer="ignore" is added, this will still strip the tag bare:

<div style="%%=v(@HelloWorld)=%%" data-premailer="ignore"></div>

becomes

<div style="" data-premailer="ignore"></div>

Whereas

<div style="%%=v(@HelloWorld)=%%; display: none" data-premailer="ignore">

becomes

<div style="display: none" data-premailer="ignore">

The only workaround I've found is to make it a valid CSS property w/ an invalid value:

<div style="display: %%=v(@HelloWorld)=%%" data-premailer="ignore"></div>

becomes

<div style="display: %%=v(@HelloWorld)=%%" data-premailer="ignore"></div>

Sawtaytoes avatar Apr 21 '14 17:04 Sawtaytoes