Skip to content

Commit a353968

Browse files
committed
fix: do a full copy
1 parent ecf5990 commit a353968

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/editor/BlockNoteEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ export class BlockNoteEditor<
930930
const ret = oldCreateAndFill.apply(this.pmSchema.nodes.doc, args)!;
931931

932932
// create a copy that we can mutate (otherwise, assigning attrs is not safe and corrupts the pm state)
933-
const jsonNode = ret.toJSON();
933+
const jsonNode = JSON.parse(JSON.stringify(ret.toJSON()));
934934
jsonNode.content[0].content[0].attrs.id = "initialBlockId";
935935

936936
cache = Node.fromJSON(this.pmSchema, jsonNode);

0 commit comments

Comments
 (0)