过滤器安全不适用于害羞标签问题
Filter safe does not work on the shy tag issue
我在 Django 模板的正确位置断词时遇到问题。出现 ­
我正在尝试安全过滤,但它不起作用。
这是我的代码:
<div class="my_class">
<h3>{{ object.title|safe }}</h3>
</div>
来自此处的文档:safe
safe
Marks a string as not requiring further HTML escaping prior to output. When autoescaping is off, this filter has no effect.
而且Django的模板引擎确实会自动转义,看When should I use escape and safe in Django's template system?
我在 Django 模板的正确位置断词时遇到问题。出现 ­
我正在尝试安全过滤,但它不起作用。
这是我的代码:
<div class="my_class">
<h3>{{ object.title|safe }}</h3>
</div>
来自此处的文档:safe
safe
Marks a string as not requiring further HTML escaping prior to output. When autoescaping is off, this filter has no effect.
而且Django的模板引擎确实会自动转义,看When should I use escape and safe in Django's template system?