且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Mustache.js中将文本作为HTML

更新时间:2023-11-29 11:24:04

如果要输出html,请使用三重花括号。来自文档的 {{{html}}}

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


默认情况下,所有变量都是HTML转义的。如果要渲染未转义的HTML,请使用三重胡须:{{{name}}}。你也可以用& unescape变量。

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/