[英]Marionette model data contains formatting html tags like <sup></sup>. How can I have my view honor those tags in its output?
I'm using handlebars for my templates. 我正在为模板使用把手。 The data in my model is pulled from SQL tables.
我模型中的数据是从SQL表中提取的。 Users enter this data in a form elsewhere.
用户以其他形式输入此数据。 Its medical data so sometimes the users want elements within the data to be formatted with things like superscripts.
它的医疗数据,因此有时用户希望数据中的元素使用上标之类的格式进行格式化。 Is there a way to honor such formatting in handlebars templates?
有没有办法在把手模板中采用这种格式?
By default, Handlebars will escape everything, unless you pass your text as an instance of Handlebars.SafeString: 默认情况下,除非您将文本作为Handlebars.SafeString的实例传递,否则Handlebars将转义所有内容:
return new Handlebars.SafeString(text)
See the documentation ( HTML Escaping ) or the discussion here: https://github.com/wycats/handlebars.js/issues/647 请参阅文档 ( HTML Escaping )或此处的讨论: https : //github.com/wycats/handlebars.js/issues/647
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.