Hi there.
This is a great library, thank you for your work.
I am getting this problem: when I add one of my custom nodes to the document, all the attrs change for all of the other nodes of that kind to the last value input.
What am I doing wrong?
here I insert the node
let nodeToInsert = nodeType.create();
nodeToInsert.attrs.length = attrs.length;
view.dispatch(view.state.tr.replaceSelectionWith(nodeToInsert, true));
and here the node is defined
break: {
attrs: {
type: {default: ""},
length: {default: 0},
},
inline: true,
group: "inline",
isText: true,
toDOM: node => [
"break",
{
"break-type": node.attrs.type,
title: node.attrs.type,
class: "break-tag"
},
"" + node.attrs.type + " " + node.attrs.length + " ms "
],
parseDOM: [{tag: "break"}]
},
I would appreciate any help. Thank you