5
我们正在使用Mustachejs转换旧CMS。 内容的主体包含了一些HTML元素:Mustachejs将html标记呈现为html
<strong>Mickey Mouse</strong> is a funny animal cartoon character created in 1928 by Walt Disney.
我们我们运用价值Mustachejs像{{说明}}
渲染输出是
<strong>Mickey Mouse</strong> is a funny animal cartoon character
created in 1928 by Walt Disney.
Mustachejs字面上显示数据库中的值。
我们如何让Mustachejs将html标记呈现为html?
所需的结果
米老鼠是沃尔特·迪斯尼于1928年创建了一个有趣的动物卡通人物 。
完美...很简单。爱慕胡子JS到目前为止。 – 2013-03-07 14:06:20
请注意,当您在用户输入中使用三个大括号时,在呈现之前应仔细清理它。 – bobthecow 2013-03-07 14:33:29
而且你绝对应该*无论什么* @ bobthecow关于小胡子的说法! – Popnoodles 2013-03-07 18:03:11