ckeditor 正在删除表格边框样式

如何解决ckeditor 正在删除表格边框样式

我们正在将内容一个 ckeditor 粘贴到另一个,然后表格的边框样式将被删除

这在旧的 CKeditor 4.2 版中从未发生过,但在 4.15 版中发生。

如果您将以下 HTML 内容粘贴到新的 ckeditor 中,它将删除表格的边框样式

内容之前:

https://paste.laravel.io/ec016f9c-1abe-4bb3-ab2b-ee7ccaac1d2c

粘贴内容

https://paste.laravel.io/9d0ab427-f34c-45c3-8f1e-03949efd95cf

以下是我的配置文件

CKEDITOR.editorConfig = function( config ) {

    config.filebrowserbrowseUrl = 'browser.PHP';
    config.filebrowserFilebrowseUrl = 'browser.PHP';
    config.filebrowserImagebrowseUrl = 'browser.PHP';
    config.filebrowserVideobrowseUrl = 'browser.PHP'
    config.filebrowserFlashbrowseUrl = 'browser.PHP';
    config.uploadUrl = 'browser.PHP';
    config.extraPlugins = 'stylesheetparser,uploadimage,pastetools';
    config.filebrowserUploadUrl = 'browser.PHP';
    config.imageUploadUrl = 'browser.PHP';
    config.allowedContent = true;
    config.extraAllowedContent = 'table(*)';
    config.pasteFromWordRemoveStyles = false;
    config.extraAllowedContent = 'table{background*,border*,style*,style,border}';
    config.filebrowserUploadMethod = 'form';
    config.disableNativeSpellChecker = false;
    config.toolbar_Full = [
        { name: 'document',groups: ['mode','document','doctools'] },{ name: 'clipboard',groups: ['clipboard','undo'],items: ['Cut','copy','Paste','PasteText','PasteFromWord','Undo','Redo'] },// On the basic preset,clipboard and undo is handled by keyboard.
        // Uncomment the following line to enable them on the toolbar as well.
        { name: 'insert',items: ['CreatePlaceholder','Image','Table','HorizontalRule','Smiley','SpecialChar'] },{ name: 'links',items: ['Link','Unlink','Anchor'] },{ name: 'paragraph',groups: ['list','indent','blocks','align'],items: ['NumberedList','BulletedList','Outdent','Indent','Blockquote','CreateDiv','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','BidiLtr','BidiRtl'] },{ name: 'basicstyles',groups: ['basicstyles','cleanup'],items: ['Bold','Italic','Underline','Subscript','Superscript','RemoveFormat'] },{ name: 'styles',items: ['Styles','Format','Font','FontSize'] },{ name: 'colors',items: ['TextColor','BGColor'] },{ name: 'tools',items: ['UIColor','Maximize','PageBreak'] },];
    config.removePlugins = 'easyimage,cloudservices,exportpdf';
    config.skin = 'moono';
    config.toolbar = "Full";

    //it will remove additional font style
    CKEDITOR.addCss(".cke_editable span[lang] {font-style: inherit;}");
};


//!forcefully show copy/pase dialog Box if brower not support due to security concern.
CKEDITOR.on("instanceReady",function(event) {
    event.editor.on("beforeCommandExec",function(event) {
        // Show the paste dialog for the paste buttons and right-click paste
        if (event.data.name == "paste") {
            event.editor._.forcePasteDialog = true;
        }
        // Don't show the paste dialog for Ctrl+Shift+V
        if (event.data.name == "pastetext" && event.data.commandData.from == "keystrokeHandler") {
            event.cancel();
        }
    })
});

基本上我想关闭 CKeditor 在复制粘贴时删除表格的样式属性的行为。

我尝试了所有可能的解决方案并进行了大量谷歌搜索,但我找不到任何解决方案。

我发现的一个解决方案是:config.pasteFilter = null;

我认为这会禁用所有过滤,但我只想允许 CKeditor 的边框。如果有人找到最佳解决方案,请告诉我

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?