plate
plate copied to clipboard
Missing id with deserializeHtml
Description
When a Plate editor is created with the createNodeIdPlugin
I would expect html that is deserialized to contain ids.
If you run this code in the browser then if functions correctly and id's are added but if you run in a test framework then all the ids are missing.
My intention is to be able to run a deserialize command in a process in a server, thus the lack of a dom.
- Expected
+ Received
Array [
Object {
"children": Array [
Object {
"text": "Paragraph",
},
],
- "id": "1",
"type": "p",
},
]
❯ src/index.spec.ts:23:17
21|
22| console.log(doc);
23| expect(doc).toEqual(expected);
| ^
24| });
25| });
Steps
- Go to https://codesandbox.io/p/sandbox/serene-greider-vw85kd?file=%2Fsrc%2Findex.ts
- Run the
test
task, see the test failure.
Sandbox
https://codesandbox.io/p/sandbox/serene-greider-vw85kd?file=%2Fvite.config.ts%3A1%2C37
Expectation
ID's are added to the deserialized blocks.
Funding
- You can sponsor this specific effort via a Polar.sh pledge below
- We receive the pledge once the issue is completed & verified