Fix some issues with pasting image urls#59
Open
bobjflong wants to merge 2 commits intoianstormtaylor:masterfrom
Open
Fix some issues with pasting image urls#59bobjflong wants to merge 2 commits intoianstormtaylor:masterfrom
bobjflong wants to merge 2 commits intoianstormtaylor:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Thanks for a great package!
I think there might be an issue with pasting image urls. For example, when I copy and paste a URL from the Chrome address bar into the demo, it doesn't seem to convert it to an image:
I think this might be different depending on browser/OS/etc, but for me the transfer type is HTML, not text, so I think that's the problem here. I've made a change here that doesn't use the
texttransfer type when deciding if the content is a URL to convert.Additionally I think this caller of
asyncApplyChangemight be incorrect: https://github.com/ianstormtaylor/slate-plugins/compare/master...bobjflong:BL/fix-paste-images?expand=1#diff-d52935d8da17e52dfbb28f4ad6930467L186Additionally, I feel that this conversion might be very opinionated. I think it's a normal expectation that a pasted URL wouldn't automatically become a visual image. For that reason, I've added a
convertUrlsToImagesconfig item which defaults totrue.