使用Javascript进行胡子渲染问题

Dev*_*xon 3 html javascript mustache

我刚刚开始使用Mustache,我有这个渲染问题.我通过渲染函数发送数据:

return Mustache.render(html, data);
Run Code Online (Sandbox Code Playgroud)

要么

return Mustache.to_html(html, data);
Run Code Online (Sandbox Code Playgroud)

但是当我将它附加到div时:

$('#jqt').append(html);
Run Code Online (Sandbox Code Playgroud)

它在实际文本中给出了这样的结果:

<div id="product_search_view">&lt;form class="search-form" &gt;&lt;ul class="rounded"&gt;&lt;li&gt;&lt;input type="text" id="label" name="search" placeholder="Enter what you are looking for"&gt;&lt;/li&gt;&lt;/ul&gt;&lt;a href="#" class="whiteButton submit" id="search-button" &gt;Search&lt;/a&gt;&lt;/form&gt;&lt;ul id="search-results" class="edgetoedge"&gt;&lt;/ul&gt;</div>
Run Code Online (Sandbox Code Playgroud)

如何让小胡子不要放入这些角色?

Jos*_*eph 11

好像你已经将已经解析过的HTML传递给了Mustache.

这是文档的一部分,用于解决转义字符和"三重胡子"的使用.

另外,这是另一个文档.阅读标签类型部分以及使用它&来防止转义.