为什么Django admin中的TinyMCE输出HTML标记? [英] Why does TinyMCE in Django admin output HTML tags?

查看:51
本文介绍了为什么Django admin中的TinyMCE输出HTML标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个应用程序使用相同的 TinyMCE 文本区域配置.但是,虽然一个应用程序中的输入确实可以正确输出文本,但是另一个应用程序中的相同输入却不能正确输出文本-它会输出< p>< li> 标记等.

对于这两个不同的应用程序,我拥有完全相同的Django源代码.如上所述,两个使用相同TinyMCE textarea的应用程序.这怎么可能发生?

解决方案

请确保您使用的是转义标记"safe",例如 {{value | safe}} ,因此,它不会t显示TinyMCE的HTML代码安全.

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?

解决方案

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

这篇关于为什么Django admin中的TinyMCE输出HTML标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆