Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does TinyMCE in Django admin output HTML tags?

Tags:

django

tinymce

I have two apps using the same TinyMCE textarea configurations. However, while an input in an app does output the text properly, the same input in another app does not output the text properly -it outputs the <p> <li> tags, etc.

I have exactly the same Django source code for these two different apps. As I mentioned above, two apps using the same TinyMCE textarea. How come this could happen?

like image 460
israkir Avatar asked Dec 10 '22 15:12

israkir


1 Answers

Make sure you are using the template filter safe, like this {{ value|safe }} so it doesn't show the HTML code from TinyMCE.

More info safe:

like image 110
eos87 Avatar answered Dec 28 '22 07:12

eos87