Secured Markdown in Django
Does anybody know is there any django app/li开发者_如何学Cb which give secured Markdown or other markup language? Or there is no any way to give users to use Markdown in secured for my server way?
An also great solution that isn't mentionned in the link indicated in the comments, is the use of markdown2.
If you like using markdown2 ;)
And it has also a secure mode in order to avoid html/js/css execution, so it would fit your needs! :)
return Markdown(safe_mode="replace/escape/Boolean").convert(text)
You can use :
- replace : will replace the html by an horrible text :p
- escape : Will escape the html text (what I prefer)
- Boolean: if set to True, will use replace. Boolean is here for retro-compatibility
精彩评论