dwightjack / grunt-premailer

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

& instead of & in queryString attachment #45

Open piotr17 opened 7 years ago

piotr17 commented 7 years ago

I'm using queryString option to create a Google Analytics link with utm parameters.

Premailer convert the & conjiunction with the entity, breaking the link monitoring.

Correct link  ?utm_source=SOURCENAME?utm_medium=MEDIUNAME
Premailer output: ?utm_source=SOURCENAME&utm_medium=MEDIUNAME
dwightjack commented 7 years ago

I believe that's the correct behavior, if the & isn't encoded it would break html validation , isn't it?

piotr17 commented 7 years ago

Sorry, my issue was not clear (and i've made a little mistake in the "correct link"). It's perfectly right that the final url should have the encoded &, even if now HTML5 it's less strict on it.

But the scope (in my case and i think for many other users) is to use your plug-in for manipulating the code before using it in an Email Marketing Platform such as Mailup or Mailchimp. In these cases the code will be parsed by the internal converter that will encode the & of "&" once again, risking of breaking the tracking paramenter. Maybe for the future it could be interesting to have an option of enconding or not the &, depending on the final sending system.