inky icon indicating copy to clipboard operation
inky copied to clipboard

Inliner still converts "=" to = and "&" to & and other special characters.

Open natantata opened this issue 6 years ago • 4 comments

I've read the work being done on this issue, but I am using Foundation v2.2.1 and it is not fixed. Here's an example:

In my layout file I have the following code: <a href="{{email.url}}{{email.urlsuffix}}{{womens}}</a> These refer to the following front matter in the page:

---
url: "https://myurl.com"
urlsuffix: "/sfc3/index.cfm?changeWebsite=US_en"
womens: "&route=c_store.browseProductsByCategory&CategoryId=c4"
---

Foundation parses it like this: <a href="https://myurl.com/sfc3/index.cfm?changeWebsite&#x3D;US_en&amp;route&#x3D;c_store.browseProductsByCategory&amp;CategoryId&#x3D;c4</a>

That doesn't work for most email clients, and I can't manually find/replace all the instances by hand.

Could someone please help me with this issue? It's a real show-stopper for the project I'm working on, and I'm not getting anywhere with the existing solutions out there.

natantata avatar Jul 05 '17 16:07 natantata

same problem here!

gperdomor avatar Jan 30 '18 00:01 gperdomor

I think the problem is here

// lib/inky.js
 // // Because the structure of the DOM constantly shifts, we carefully go through each custom tag one at a time, until there are no more custom tags to parse
while ($(tags).length > 0) {
    var elem = $(tags).eq(0);
    var newHtml = this.componentFactory(elem); <------- HERE
    console.log("newHtml",newHtml)
    elem.replaceWith(newHtml);
}

gperdomor avatar Jan 30 '18 15:01 gperdomor

This has to do with handlebars. I had the same problem and fixed it by using three curly brackets: {{{womens}}}

Handlebars HTML-escapes values returned by a {{expression}}. If you don't want Handlebars to escape a value, use the "triple-stash", {{{ from http://handlebarsjs.com/expressions.html

elcaptain avatar Aug 08 '19 14:08 elcaptain

I see this is an old issue but I'm having trouble with this converting & to &amp; in button URLs which my front-end application framework also mis-handles, but shouldn't be encoded in the first place I don't think.

silverbackdan avatar Mar 22 '21 16:03 silverbackdan