TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.89k stars 381 forks source link

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

Open wenerme opened 6 days ago

wenerme commented 6 days ago

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

matthewlipski commented 5 days ago

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.