ckeditor自动删除空盘区 [英] ckeditor removing empty span automatically

查看:267
本文介绍了ckeditor自动删除空盘区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ckeditor和我有很多奇怪的问题。

i am using ckeditor and i have vary strange issue.

它会自动删除< span> 例如

 <span class="new-class"></span>

自动移除。

为最后2天的解决方案,但没有成功。我尝试在

i am searching for solution for last 2 days but no success. i try to put following code in

config.js

config.js

CKEDITOR.config.allowedContent = true;

但未成功。

在html中添加以下代码,其中我使用ckeditor但没有成功。

i also add following code in html where i use ckeditor but no success.

   <script>     
var editor = CKEDITOR.replace( 'editor1', {
allowedContent: true,
    } );
   </script>    

感谢

推荐答案

您会在此问题中找到两个有效答案: CKeditor strip< i>标签

一个人说,如果你想在编辑器中看到它们,就不可能保留它们,第二个说你可以阻止它们被删除,但是你将隐藏他们。

One says it's not possible to keep them if you want to see them in the editor and second says that you can prevent them from deleting, but you'll hide them.

这篇关于ckeditor自动删除空盘区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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