dwightjack / grunt-premailer

Grunt wrapper task for Premailer
MIT License
114 stars 16 forks source link

PHP output get's confused with `r>`, `d>` and `=>` #22

Closed XianHain closed 9 years ago

XianHain commented 10 years ago

Any r>, d> or => inside PHP tags will output to ?>.

minijus commented 9 years ago

@CRHain88 Did you manage to solve this issue? I found out the same problem recently. I did a bit of research and released that this is not caused by grunt-premailer but by premailer itself (tested it in CLI). To be more specific, '=>' is changed to '?>' when premailer is using hpricot. And switching to nokogiri instead does not solve the problem since '>' then becomes '&gt ;'(without space) and '=>' sometimes '=?>'

amclin commented 9 years ago

In my experience, you're best running premailer against the final output, instead of PHP or other language templates.

minijus commented 9 years ago

@amclin would you suggest first prefilling all personal information like name, registration confirmation link and only then parse it with premailer? What impact on server load does this have in your experience ?

amclin commented 9 years ago

If it's for batch processing, I wouldn't run on every recipient. Instead I'd run premailer on my markup with dummy content, and convert the output of that into PHP templates.

dwightjack commented 9 years ago

Hi,

sadly I'm not that much into Ruby to be able to look at it. I guess you'll have better luck opening an issue in the premailer repo.

Anyway I also suggest to run premailer against a template and then make it dynamic by addind PHP tags.