krzyhub
krzyhub

Reputation: 6540

Secured Markdown in Django

Does anybody know is there any django app/lib 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?

Upvotes: 2

Views: 303

Answers (1)

Cyril N.
Cyril N.

Reputation: 39889

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

Upvotes: 3

Related Questions