为什么TinyMCE在(django){%}}标签之间插入 span>?

时间:2022-09-30 08:39:44

My application features a CMS for editing Django templates.

我的应用程序具有用于编辑Django模板的CMS。

Whenever I type something like

每当我输入类似的东西

{% sometag %}

TinyMCE will actually store

TinyMCE实际上会存储

{%<span>sometag</span>%}

Is there any way to prevent TinyMCE from doing this?

有没有办法阻止TinyMCE这样做?

2 个解决方案

#1


10  

Ok! I got it. The elements were only being added when I pasted content. And there's a TinyMCE initialization setting to stop this

好!我知道了。仅在粘贴内容时才添加元素。还有一个TinyMCE初始化设置来阻止它

         'paste_remove_spans': True,

#2


0  

Try opening the HTML view and adding the code from there. That should stop TinyMCE from changing anything.

尝试打开HTML视图并从那里添加代码。这应该会阻止TinyMCE改变任何事情。

#1


10  

Ok! I got it. The elements were only being added when I pasted content. And there's a TinyMCE initialization setting to stop this

好!我知道了。仅在粘贴内容时才添加元素。还有一个TinyMCE初始化设置来阻止它

         'paste_remove_spans': True,

#2


0  

Try opening the HTML view and adding the code from there. That should stop TinyMCE from changing anything.

尝试打开HTML视图并从那里添加代码。这应该会阻止TinyMCE改变任何事情。