开发者

In Django, is there a built in filter which can mark these as safe?

开发者 https://www.devze.com 2023-02-01 01:02 出处:网络
> <strong> HTML tags, and much more (these 3 are just examples) Is there a filter that I actually render these in Django template, but开发者_C百科 keep tags escaped. No, there
> <strong>

HTML tags, and much more (these 3 are just examples)

Is there a filter that I actually render these in Django template, but开发者_C百科 keep tags escaped.


No, there isn't - if you mark something as safe, nothing will be escaped. If it's unsafe, everything will be. There isn't really way to say this content is varying degrees of safe - so if you want this, you'll have to write it yourself.


This should help but not bundled with Django:

http://djangosnippets.org/snippets/295/

0

精彩评论

暂无评论...
验证码 换一张
取 消