BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

Paste from other web page will use the url instead the png

Open wenerme opened this issue 1 year ago • 1 comments

Describe the bug

BlockNode should provide a way to handle paste Image when copy from web page, there are tow types

text/html
image/png

BlockNote use text/html may cause the origin block, the paste content is

<meta charset="utf-8"><img src="https://" alt="Image">

the src is from other site, I hope I can handle this upload by using the url, or at least use the png

To Reproduce

  1. copy image from other web site
  2. paste into BlockNote
  3. inspect the image, the url is from other site.

Misc

  • Node version:
  • Package manager:
  • Browser: Chrome latest
  • [ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖

wenerme avatar Jun 26 '24 09:06 wenerme

HI, agree this is a valid use case. Currently we want pasted images to use the source URL as it means you don't have to implement uploadFile for it to work, but it can make sense to upload them if you do implement it so you can make sure you always have access to it.

Also just fyi you can upload image/png images with copy/paste and drag/drop now if you implement uploadFile, Just realized that the docs for file blocks need updating and are missing such info, sorry about that.

matthewlipski avatar Jun 26 '24 22:06 matthewlipski

When I copy content including text and images from other websites and paste it into BlockNote, the image source uses the original image URL, which is fine. However, when the source of the original image (or file) is a URL containing a token, the image fails to load.

nickGaooooooooooo avatar Oct 09 '24 04:10 nickGaooooooooooo