nozer/quill-delta-to-html

Images are being incorrectly encoded when containing special characters (parenthesis)

Opened this issue · 2 comments

I'm noticing that whenever I upload screenshots I take with Windows 10, they appear correctly in the Quilljs editor itself just fine, but quill-delta-to-html improperly tries to encode them, therefor breaking the URLs and not displaying them.

This leads to dead images due to 404 errors.

Windows 10 creates screenshots with a convention of:

Screenshot (2).png

That is, "Screenshot", followed by a space, followed by parenthesis holding an incremented number. This is stored in Quilljs as:

[{"insert":{"image":"https://example.com/image/Screenshot%20(2).png"}}]

The resulting URL output by quill-delta-to-html is:

https://example.com/image/Screenshot%20(2).png

Tested in 0.10.13 and 0.11.0 and seems broken in both.

If you can confirm this is an issue and it's not just my misunderstanding of how things should work, then I'd be happy to look into finding a fix and creating a PR for it if you'd like.

@SikoSoft it does look like bug, PR is welcome with tests