[英]How to render italic/bold text using handlebars?
So here is the thing, I am using Handlebars to render the template on the page. 这就是问题,我正在使用Handlebars在页面上呈现模板。
Now in the context js object, I have a paragraph, which should have few italic words, 现在在上下文js对象中,我有一个段落,应该用斜体字表示,
For eg: 例如:
var context = {
"event":"This is event name <i>XYZ</i>"
}
And the paragraph is rendered as, 该段表示为
This is event name <i>XYZ</i>
Is there any way I can make/escape the font italic/bold in Handlebarsjs/Mustachejs ?? 有什么方法可以使Handlebarsjs / Mustachejs中的字体变成斜体/粗体吗?
Thanks! 谢谢!
Try using the triple-stache 尝试使用三重步
{{{thing_to_render_unescaped}}}
http://jsfiddle.net/a9dp62g4/1/ http://jsfiddle.net/a9dp62g4/1/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.