我试图让Jade不解释我的模板的一部分,根据文档应该可以使用管道或点(请参阅http://jade-lang.com/reference/plain-text/)。强制Jade不解释纯文本
我所看到的反而是Jade解释了管道html而不是传递它。因此,例如这个模板:
div.controls
| <select id="someid" anotherProp>
| </select>
会生成以下HTML:
<div class="controls">
<select id="someid" anotherprop=""></select>
</div>
相反的:
<div class="controls">
<select id="someid" anotherProp></select>
</div>
注意 “anotherprop” 被下套管和= “” 是添加。搜索后,我甚至不能确定玉能够真正的纯文本的...
语境 这个例子被简化,我想包括在生成的HTML模板胡子在单页使用应用程序。例如,上面的“anotherProp”在我的实际代码“{{#disable}} disabled {{/ disable}}”中,但它被Jade转换为垃圾。我发现了一个解决方法,它不在Jade模板的“纯文本”部分中使用“<”和“>”,而是使用占位符代替(我使用相应的HTML实体),然后在呈现Mustache之前用Javascript代替这些实体模板。对我而言,这太难看了。