I am trying to write an inline NodeSpec to replace emoji unicode characters with inline images. It works for pasting emoji characters, since we can use the
transformPasted prop to detect and then insert emoji nodes.
Is there a way to write the opposite equivalent, like a
transformCopied, that could be used to transform an emoji node back into a textual representation?
(I was partially motivated by seeing github use inline images for emojis on its blog. If you scroll to the post script and copy the last paragraph which has an image representation , it’s alt is copied if you paste it into an editor or url bar.)
Edit: It also works here on discuss if you copy and paste the above sparkles emoji. I initially thought it may be a default browser behavior of copying the image alt, but it doesn’t work with prosemirror in contenteditable true or false when I have an inline emoji image with an alt specified.