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

funston picture funston  路  7Comments

mbrodala picture mbrodala  路  16Comments

chlab picture chlab  路  11Comments

rlightner picture rlightner  路  7Comments

amper5and picture amper5and  路  5Comments