首页 > Web开发 > 详细

how to render html tag

时间:2019-05-10 14:55:36      阅读:111      评论:0      收藏:0      [点我收藏+]

使用autoescaping

If autoescaping is turned on in the environment, all output will automatically be escaped for safe output. To manually mark output as safe, use the safe filter. Nunjucks will not escape this output.

开启autoescaping后,所有的输出会自动转义以获得安全输出.但是nunjucks模板不会自动转义输出,需要手动开启,开启方式:

{{ foo }}           // <span%gt;
{{ foo | safe }}    // <span>

how to render html tag

原文:https://www.cnblogs.com/zxhyJack/p/10844324.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!