解决ckeditor 粘贴样式不能显示的问题

发布时间:2020-02-18 12:00:43,浏览3881次

通过如下设置即可解决ckeditor 粘贴样式不能显示的问题

CKEDITOR.config.pasteFilter=null; //粘贴过滤器设置为null 即可 

CKEDITOR.config.allowedContent = {//内容规则 允许的标签
    $1: {
        // Use the ability to specify elements as an object.
        elements: CKEDITOR.dtd,
        attributes: true,
        styles: true,
        classes: true
    }
};

CKEDITOR.config.disallowedContent = 'script; *[on*];img{width,height};img[width,height]';//内容规则 不允许的标签
评论