Closed PibeG closed 3 years ago
This behaviour is also seen when copy-pasting slate (ast) images within the editor, so I imagine it's not specifically related to the HTML deserialization, but more likely one of the insertion helper functions: https://codesandbox.io/s/plate-reproduction-image-ast-deserializing-7cler?file=/index.tsx Try copying the image and pasting it into an empty paragraph.
This should be fixed on Slate 0.66 gets released, namely with https://github.com/ianstormtaylor/slate/pull/4489 and then after we land https://github.com/udecode/plate/pull/995 and release. So probably sometime next week this should work.
In the interim, you could add a custom preInsert
method that does not attempt to rewrite the first node type.
Ah great, thanks for the update.
Thanks @dylans, I'll close this since #995 is just waiting review
Description
After copying an image (eg. from wikimedia) and pasting it into an empty paragraph, an 'image' node without the "url" property is created.
Steps
Sandbox
https://codesandbox.io/s/plate-reproduction-image-deserializing-o2g4m
Expectation
If you paste the same image in any other paragraph, the editor splits the content and creates the 'image' node correctly.
Environment
Funding