quill
quill copied to clipboard
Add support for blob URL images
Expected behavior:
Expects that the following code
// file is a file opened with image dialog selector
let blobUrl = URL.createObjectURL(file); // url will contain something like blob:http://HOST/BLOB-UUID
quill.insertEmbed(quill.getSelection(), 'image', blobUrl);
Inserts an image with the blob url specified.
Actual behavior:
Actually the editor is inserting an image with src = '//:0'
Platforms: Any
Version:
2.0.2 and below
BTW, I've noticed that this code
https://github.com/quilljs/quill/blob/9f4e18540de93e8dec7cb7f53d8d0493714b7a09/packages/quill/src/formats/image.ts#L34-L36
is where the url is being sanitized. What about adding 'blob' to the current array to allow blob urls?
Thanks in advance
I just added a PR #4208 that allows blob urls for inserted images