var E = window.wangEditor;
editor = new E('#toolbar',"#DescriptionInfo");
editor.customConfig.uploadImgShowBase64 = true;
// 或者 var editor = new E( document.getElementById('editor') )
//以下方法是清除复制过来的文字样式方法
editor.customConfig.pasteTextHandle =function(content){
if(content ==''&&!content)return'';
var str = content;
//以下方法删除样式,具体内容可以根据需要自己写正则表达式
str = str.replace(/<xml>[\s\S]*?<\/xml>/ig,'');
str = str.replace(/<style>[\s\S]*?<\/style>/ig,'');
str = str.replace(/<\/?[^>]*>/g,'');
str = str.replace(/[ | ]*\n/g,'<p>');
str = str.replace(/ /ig,'');
//end
return str;
}
editor.create();
以下是在工具栏增加清除样式按钮(引用他人)