Skip to content

Comments

Fix some issues with pasting image urls#59

Open
bobjflong wants to merge 2 commits intoianstormtaylor:masterfrom
bobjflong:BL/fix-paste-images
Open

Fix some issues with pasting image urls#59
bobjflong wants to merge 2 commits intoianstormtaylor:masterfrom
bobjflong:BL/fix-paste-images

Conversation

@bobjflong
Copy link

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:

Screen Shot 2020-01-15 at 12 42 45 PM

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 text transfer type when deciding if the content is a URL to convert.

Additionally I think this caller of asyncApplyChange might be incorrect: https://github.com/ianstormtaylor/slate-plugins/compare/master...bobjflong:BL/fix-paste-images?expand=1#diff-d52935d8da17e52dfbb28f4ad6930467L186

Additionally, 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 convertUrlsToImages config item which defaults to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant