Strings are shown with quotation marks


#1

Dear all,

I just recently realized that using a stach {{variable}} will render “value of variable” (including the quotation marks) in html.

Is there a way to turn this off? From the database I fetch html stored in the variable and with the quotation marks in place, all html tags are visible to the end user. The desired text formatting is not taking place of course.

Thanks,

Nada


#2

Stache does not do that. Does your data have the quotation marks.


#3

Hi Justin,

you are right. Chrome puts quotes around text nodes.
So it looks like the content of the variable is rendered as text node.
E.g. < is written as &lt;

Any way to prevent this?
Probably not so I can’t put html into a variable and expect it to be rendered properly?

Cheers,

Nada


#4

If you want to output unescaped markup, use 3 curly braces: {{{variable}}}


#5

Ha, thanks a lot. I knew it would be something simple :smiley: