When using Baidu editor umeditorv1.2.2 to upload pictures and insert them into the editor, the domain name will be as follows:
<img src="http://www.xxx.xxx/uploads/20161006/14757579522304.jpg" _src="http://www.xxx.com/uploads/20161006/14757579522304.jpg"/>
According to common sense, there should be related configuration to remove this domain name, but I didn't find it, the following is my solution
Find line 36 of the js file ueditor\dialogs\image\image.js
Change it to the following, replace the domain name in the image path
$.each($imgs, function(index, node) {
$(node).removeAttr("width").removeAttr("height");
// if (node.width > editor.options.initialFrameWidth) {
// me.scale(node, editor.options.initialFrameWidth -
// parseInt($(editor.body).css("padding-left")) -
// parseInt($(editor.body).css("padding-right ")));
// }
//The following line is the newly added code, and a new imgsrc variable is added. Note that the path of node.src is used directly.
var imgsrc = node.src.replace(window.location.protocol + '//' + window.location.hostname, '');
return arr.push({
_src: imgsrc,
src: imgsrc
});
});
The effect after modification
Then configure next :