浏览代码

Update src/imageupload/utils.js

Co-Authored-By: f1ames <dr.odpowiedz@gmail.com>
Piotrek Koszuliński 7 年之前
父节点
当前提交
e6a3d3d007
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      packages/ckeditor5-image/src/imageupload/utils.js

+ 5 - 0
packages/ckeditor5-image/src/imageupload/utils.js

@@ -59,6 +59,11 @@ export function wrapImageToFetch( image, index ) {
 export function isLocalImage( node ) {
 	return node.is( 'element', 'img' ) && node.getAttribute( 'src' ) &&
 		( node.getAttribute( 'src' ).match( /data:image\/\w+;base64,/g ) ||
+			if ( !node.is( 'element', 'img' ) || node.getAttribute( 'src' ) ) {
+				return false;
+			}
+			
+			return ( node.getAttribute( 'src' ).match( /data:image\/\w+;base64,/g ) ||
 		node.getAttribute( 'src' ).match( /blob:/g ) );
 }