In Django, is there a built in filter which can mark these as safe?
> <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/
精彩评论