foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Front matter equal sign gets converted to entity #162

Closed jkd77 closed 6 years ago

jkd77 commented 6 years ago

I can't seem to successfully escape an equals sign "=" using double quotes within Front Matter. I've also tried single quotes and a myriad of YAML solutions: https://stackoverflow.com/questions/11301650/how-to-escape-indicator-characters-i-e-or-in-yaml

Unfortunately, the = still gets converted to = When an = is outside of Front Matter, it is kept as a = character via inliner. Thoughts? Fixes?

gakimball commented 6 years ago

When you say "inliner", are you doing any processing of the files after Panini? Like are you using this with Foundation for Emails?

jkd77 commented 6 years ago

Correct. I'm using this with Zurb Foundation for Emails.

gakimball commented 6 years ago

Alright, it might be something to do with Cheerio, which parses the HTML.

Could you post what's going wrong with the outputted HTML, and what you expect it to look like?

jkd77 commented 6 years ago

In front matter I have: intro-text: "Your Brand [PRODUCT,fallback=Product] Needs an Important Update."

The above just needs to get put into the necessary variable placeholder in the page, as-is. However it gets converted to:

Your Brand [PRODUCT,fallback=Product] Needs an Important Update.

In order for the above to work in my email service, I must have the = instead of =. Thoughts?

gakimball commented 6 years ago

Got it! Handlebars escapes any HTML characters by default, like =, <, and >. To bypass this, use three curly braces around a value, like {{{ this }}}.

Also, because of this issue, I found a bug in an email template I'm working on that I didn't even know I had yet 😅 So thanks for that!

jkd77 commented 6 years ago

Awesome, that totally fixes my issue. Thanks! Glad it helped you as well. #bonus