UEditor 直接复制黏贴图片为空的问题

UEditor 直接复制黏贴图片为空的问题

问题

步骤:复制淘宝的图文详情,直接黏贴到百度富文本编辑器
现象:只能复制文字,图片相关内容为空,查看 html 代码,复制的内容不包含 img 标签

解决方案

1.找到ueditor.config.js文件,搜索catchRemoteImageEnable字段,设置为false

//设置远程图片是否抓取到本地保存
catchRemoteImageEnable: false, //设置是否抓取远程图片

2.同样是ueditor.config.js文件,搜索pasteplainfilterTxtRules字段,注释这两个字段

// pasteplain:true,  //是否默认为纯文本粘贴。false为不使用纯文本粘贴,true为使用纯文本粘贴
//纯文本粘贴模式下的过滤规则
// 'filterTxtRules' : function(){
//    function transP(node){
//        node.tagName = 'p';
//        node.setStyle();
//    }
//    return {
//        //直接删除及其字节点内容
//        '-' : 'script style object iframe embed input select',
//        'p': {$:{}},
//        'br':{$:{}},
//        'div':{'$':{}},
//        'li':{'$':{}},
//        /*'caption':transP,
//        'th':transP,
//        'tr':transP,
//        'h1':transP,'h2':transP,'h3':transP,'h4':transP,'h5':transP,'h6':transP,*/
//        'caption': {$:{}},
//        'th':{$:{}},
//        'tr':{$:{}},
//        'h1':{$:{}},'h2':{$:{}},'h3':{$:{}},'h4':{$:{}},'h5':{$:{}},'h6':{$:{}},
//        'td':function(node){
//            //没有内容的td直接删掉
//            var txt = !!node.innerText();
//            if(txt){
//                node.parentNode.insertAfter(UE.uNode.createText('    '),node);
//            }
//            node.parentNode.removeChild(node,node.innerText())
//        }
//    }
// }(),
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值