quill icon indicating copy to clipboard operation
quill copied to clipboard

Add support for blob URL images

Open didix16 opened this issue 1 year ago • 1 comments

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

didix16 avatar May 14 '24 14:05 didix16

I just added a PR #4208 that allows blob urls for inserted images

didix16 avatar May 14 '24 15:05 didix16