简体   繁体   English

筛选器安全不适用于害羞标签问题

[英]Filter safe does not work on the shy tag issue

I have a problem with breaking words in the right place at the Django template. 我在Django模板的正确位置打断单词时遇到问题。 Appears ­ 出现­ I'm trying to filter safe, but it does not work. 我正在尝试过滤安全的容器,但是它不起作用。

Here is my code: 这是我的代码:

    <div class="my_class">
        <h3>{{ object.title|safe }}</h3>
    </div>

From the doc here: safe 从这里的文档: 安全

safe 安全

Marks a string as not requiring further HTML escaping prior to output. 将字符串标记为不需要在输出之前进一步转义HTML。 When autoescaping is off, this filter has no effect. 关闭自动转义功能时,此过滤器无效。

And Django's templating engine does escaping automatically, look When should I use escape and safe in Django's template system? 并且Django的模板引擎会自动转义,看起来我应该何时在Django的模板系统中使用转义和安全?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM