You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you copy and paste image into editor and after that you copy and paste text image will disappear.
To reproduce this:
Select an image, copy it to clipboard.
Paste image into editor.
Select text and copy it to clipboard.
Paste text after image.
I've traced this problem to:
/src/clipboard.js
functionmarkAndGetInlineImagesAndRemoveForbiddenOnes($editor,invalidImageSelector,fileTypes){
.....// What is the point of this??? Why should original src should be changed to loadingImg???pngImages.forEach(function(_a){varel=_a.el;returnel.setAttribute('src',loadingImg);});returnpngImages;
Which will always return empty... thus "screenShotUrl" will be empty.
functionpersistInlineImages($editor,screenshotSaver,invalidImageSelector,fileTypes){setTimeout(function(){returnPromise.all(markAndGetInlineImagesAndRemoveForbiddenOnes($editor,invalidImageSelector,fileTypes).map(function(data){returnscreenshotSaver(data).then(function(screenShotUrl){returndata.el.setAttribute('src',screenShotUrl);})// screenShotUrl will always be empty!.catch(function(err){data.el.remove();throwerr;});})).then(function(){return$editor.trigger('input');});},0);}
Fix to this could be (should mention that these are done in compiled version, not raw files):
/src/clipboard.jsfunctionmarkAndGetInlineImagesAndRemoveForbiddenOnes($editor,invalidImageSelector,fileTypes){
....varpngImages=images.filter(function(_a){vartype=_a.type;returnfileTypes.includes(type);});/* Remove this bit pngImages.forEach(function (_a) { var el = _a.el; return el.setAttribute('src', loadingImg); }); */
....}
The text was updated successfully, but these errors were encountered:
Well one could argue that there isn't any bug here. Only a really poor documentation. Since you can override all this oddly behaving copy/paste by overwriting "screenshotSaver"-option as to function which converts an array of integers to back as base64 encoded image ( although I do not know why this conversion is even made? And why src-attribute is changed to "loading" image??? I concern this as a bug).
If you copy and paste image into editor and after that you copy and paste text image will disappear.
To reproduce this:
I've traced this problem to:
/src/clipboard.js
And /src/utils.js:
Which will always return empty... thus "screenShotUrl" will be empty.
Fix to this could be (should mention that these are done in compiled version, not raw files):
And
The text was updated successfully, but these errors were encountered: