在编辑器中添加链接必须添加以http://格式开头的地址才能跳转到外链地址
如果不加,就会带入本域名地址,所以在需要设置一下:
this.editor = new E('#editor');
this.editor.customConfig.showLinkImg = false;
this.editor.customConfig.linkCheck = function(text, link) {
if (link != "") {
var reg = /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/;
if (!reg.test(link)) {
return '请输入正确的网址(例如 http://baidu.com)'
}else{
return true
}
}
}
this.editor.create(); //创建编辑器