sofn-xyz / mailing

Build, test, send emails with React
https://www.mailing.run
MIT License
3.6k stars 74 forks source link

Prevent apostrophe encoding in generated html #471

Open jbtheard opened 1 year ago

jbtheard commented 1 year ago

Describe the bug I'm trying to output a link for my CRM that is a liquid tag (that will be replaced by my CRM at the time of effectively sending email) It's actually the default unsubscribe tag for customer.io: {% unsubscribe_url lang='en' %}

To Reproduce My code is pretty much this:

<MjmlText>
  <a href="{% unsubscribe_url lang='en' %}">Unsubscribe</a>
</MjmlText>

The html output is as follow

<div><a href="{% unsubscribe_url lang=&#x27;en&#x27; %}">Unsubscribe</a></div>

As you can see, apostrophes have been encoded which will make my CRM unable to use that template.

Expected behavior we could have an option to prevent output html to encode some character and result in

<div><a href="{% unsubscribe_url lang='en' %}">Unsubscribe</a></div>
psugihara commented 1 year ago

hmm, I'm up for some version of this but I'm not sure the best way to implement. I think we'd either need to re-parse the output from mjml-react or figure out a way that they can support it via an option.

jbtheard commented 1 year ago

Perhaps some inspiration with Maizzle replaceString() ?

jbtheard commented 2 months ago

Hi there, will this ever be done ?