Can transformPasted asynchronously

what i need is to paste span id=“123” into prosemirror-editor, however i need to call api to replace id from 123 to 456 or 789 due to authority…

seems transformPasted is a good hander for this, however transfromPasted not support async…

any ideas, bro… it brothers me quite a lot

i do know in nodeView can do it, however i want tell paste behaviour from render behaviour. in my case, if next time user view the content, it should not replace id at all. i have to replace id before paste

You can return true from handlePaste to disable the default behavior, and then, when your asynchronous action finishes, try to insert the content. That’s a bit annoying, since people might move their cursor in the meantime and they generally expect paste to be synchronous, but it is possible.

2 Likes

thx a lot, i will try!