我现在正在做
var compiledHtml = Hogan.compile(templateHtml, { delimiters: '<% %>' });
这很好用。但我需要输出一些 HTML,通常我可以使用 Mustache 默认 {{{
,我如何使用自定义语法实现这一点?
最佳答案
如果您使用非标准分隔符,您仍然应该能够使用 &
来表示未转义的标记。这:
<% thing %>
<%& thing %>
相当于:
{{ thing }}
{{{ thing }}}
关于javascript - 如何为 Hogan.js 创建自定义绑定(bind)语法(非转义 HTML 版本),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31766945/