Dedecms 5.7sp1 ck编辑器word格式失效解决办法。 – D


avatar
pcwnas 2023-04-21 173

原文来自:https://www.zixuephp.com

Dedecms 5.7sp1 ck编辑器word格式失效解决办法。

打开 include\ckeditor\plugins\pastefromword\filter\default.js最后面,找到:

  1. ;CKEDITOR.cleanWord=function(h,i){if(CKEDITOR.env.gecko)h=h.replace(/(([\S\s]*?))/gi,'$1$2$3');varj=newg(),k=j.dataFilter;k.addRules(CKEDITOR.plugins.pastefromword.getRules(i));i.fire('beforeCleanWord',{filter:k});try
  2. {h=j.toHtml(h,false);}catch(l){alert(i.lang.pastefromword.error);}h=h.replace(/cke:.*?".*?"/g,'');h=h.replace(/style=""/g,'');h=h.replace(//g,'');returnh;};})();
  3. //替换为
  4. ;CKEDITOR.cleanWord=function(h,i){returnh;if(CKEDITOR.env.gecko)h=h.replace(/(([\S\s]*?))/gi,'$1$2$3');varj=newg(),k=j.dataFilter;k.addRules(CKEDITOR.plugins.pastefromword.getRules(i));i.fire('beforeCleanWord',{filter:k});try{h=j.toHtml(h,false);}catch(l){alert(i.lang.pastefromword.error);}h=h.replace(/cke:.*?".*?"/g,'');h=h.replace(/style=""/g,'');h=h.replace(//g,'');returnh;};})();

即可.