Mustache.js: If the view's like this: {"path": "/home/chalin"}

Created on 7 Aug 2017  ·  2Comments  ·  Source: janl/mustache.js

template: {"path": {{path}}}
If the view's like this: {"path": "/home/chalin"}
the result will: {"path": "\/home\/chalin"}

Most helpful comment

That's intended. Mustache.js HTML escapes values by default, if you want to avoid that, use three curly braces ("mustaches"). Example template:

{ "path": {{{path}}} }

See https://mustache.github.io/mustache.5.html for more information about the syntax and behaviour.

Closing this for now, don't hesitate to re-open if this doesn't answer your question.

All 2 comments

That's intended. Mustache.js HTML escapes values by default, if you want to avoid that, use three curly braces ("mustaches"). Example template:

{ "path": {{{path}}} }

See https://mustache.github.io/mustache.5.html for more information about the syntax and behaviour.

Closing this for now, don't hesitate to re-open if this doesn't answer your question.

Thanks for the answer!. It helped. Maybe this should goto readme?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ForbesLindesay picture ForbesLindesay  ·  14Comments

zekth picture zekth  ·  18Comments

mbrodala picture mbrodala  ·  16Comments

kuldeepdhaka picture kuldeepdhaka  ·  9Comments

rlightner picture rlightner  ·  7Comments