-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pasted images should trigger upload if Image Upload plugin is enabled #2524
Comments
This is a quite broad topic discussed already in https://github.com/ckeditor/ckeditor5-image/issues/211 and https://github.com/ckeditor/ckeditor5-easy-image/issues/14. There are few general cases to cover, however in the context of Paste from Office there are two basic flows when pasting images. In Chrome, Firefox and Edge when content is pasted from Word, images are represented with local sources ( This is a synchronous process so all content manipulation takes place on a view instance so data inserted on paste is in its final form (no transformations are applied after data is rendered in the editor). So for that case base64 images could be detected on clipboard event ( In Safari when content is pasted from Word, images are represented with local blob resource ( As fetching blobs is an asynchronous process, first the data with blobs is inserted into the editor (images are already visible) and then when each blob is fetched and converted, images sources are replaced. In that case detecting base64 images should be done on model There could be the other way around, to handle blobs in To sum up the best approach for handling images pasted from Word seems to be listening to model changes and if there are any base64 encoded images, run the upload. This will cover all browsers mentioned above without splitting the logic to two different flows. |
Feature: Support for uploading images with base64 source. Closes #246. Closes ckeditor/ckeditor5-paste-from-office#24.
Follow up of #2515.
When content containing images is pasted from Word (or any other supported Office suite) the image upload should be triggered so pasted images could be automatically uploaded to a server.
The text was updated successfully, but these errors were encountered: