Why does TinyMCE in Django admin output HTML tags?

天涯浪子 提交于 2020-02-02 04:32:09

问题


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?


回答1:


Make sure you are using the escape tag "safe". For example, {{value|safe}} to don't show the HTML code from TinyMCE safe.



来源:https://stackoverflow.com/questions/2889080/why-does-tinymce-in-django-admin-output-html-tags

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!