Hi guys, i’m trying insert different type of nodes on Enter, Shift + Enter and by clicking on the button outside of editor. All of them should have the same behavior just create different type of nodes. I found package Prosemirror-commands which handle Enter press pretty well ("Enter": chainCommands(newlineInCode, createParagraphNear, liftEmptyBlock, splitBlock),
) but i need to create different type of node, not default. I have these types of nodes, they are exactly the same just with different classes:
new Schema({
nodes: {
n: {
group: 'block',
content: 'text*',
toDOM() {
return ['p', {class: 'tagP'}, 0]
}
}
}
})
How to do it?