[ Fix : URL Copied from Image Drawer And Pasted To Quill Editor Shows Image In Preview Or View Mode ] #1165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
What was happening?
The Copy URL button from Image Drawer is used to paste a particular formatted string in the quill editor. But it won't inject the image i.e. just shows the URL from
Copy Url
button in preview or view mode.What is happening?
When the Copy URL is pasted then the Editor uses custom matcher to handle the pasted URL i.e. as soon as you paste the image by doing
ctrl
+v
, then it parse the URL and injects the corresponding image.If we want to have a functionality like Git Hub where the image URL, will be shown like this
![alt=image; scale=1.0](URL)
in editor mode and image in preview mode then to do this I'll be using ablob
package so do tell me if that functioning would be more OK.First copy changes from #1158, then from this file to see it's working
Related Issue
Fixes #1161
Motivation and Context
The Copy URL wasn't working, so made it work!!! And.....
How Has This Been Tested?
Tested locally on my machine.
Video:
codelabz-google-chrome-2024-02-04-18-42-07_9P96PldB.mp4
The copied URL now directly injects the image from firebase to Quill Editor.
Types of changes
Checklist:
NOTE:
If the image is not uploading then, there might be a CORS related issue - see in console. As the URL from firebase is directly used to upload the image to Editor and it must be happening everywhere in the app ( we can handle it by rolling a small server then fetching), but for now,
To handle it need to do some basic steps like setting up a
firebase bucket
in your Codelabz firebase project. Do look it up how to set it or, refer to issue #1053.