小编Ale*_*own的帖子

使用Meteor插入HTML标记

如何在Meteor模板中显示标记的字符串数据?

我需要在我的数据库中显示一个包含一些基本HTML标记的字符串,以便生成的文本格式正确.它目前只显示标记文本.

这是模板的相关部分:

<span class="description">{{description}}</span>
Run Code Online (Sandbox Code Playgroud)

其中{{description}}是包含标记的字符串(如"hello <br> world").

我想要它显示

hello
world
Run Code Online (Sandbox Code Playgroud)

而不是

hello<br>world
Run Code Online (Sandbox Code Playgroud)

我想这与在javascript中使用innerHTML类似.

提前致谢!

html markup templates meteor

27
推荐指数
1
解决办法
6123
查看次数

标签 统计

html ×1

markup ×1

meteor ×1

templates ×1