Text as HTML in Mustache.js

后端 未结 1 611
闹比i
闹比i 2020-12-24 11:27

I have an array like this in JavaScript:

[name: \"myname\", text: \"

my html text

\"]

Now when I use this in my Mustache t

相关标签:
1条回答
  • 2020-12-24 11:53

    use triple curly braces if you want to output html. {{{html}}}

    from the docs:

    All variables are HTML-escaped by default. If you want to render unescaped HTML, use the triple mustache: {{{name}}}. You can also use & to unescape a variable.

    https://github.com/janl/mustache.js/

    0 讨论(0)
提交回复
热议问题