Parcourir la source

Update src/imageupload/utils.js

Co-Authored-By: f1ames <dr.odpowiedz@gmail.com>
Piotrek Koszuliński il y a 7 ans
Parent
commit
e6a3d3d007
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  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 ) );
 }