How should I create a Node from json content?
for example: for the todo list example. I want to insert a todo list of 3 todo item with prefixed content.
my current roadmap is to get the json of todo lists and then create a todolist node from it then insert that node to the editor.
but I did not find a road to create a node from the json.
Thanks!
You can do something like this:
const doc = this.editor.getJSON()
doc.content.push({
type: 'custom_node',
attrs: {},
content: [{
type: 'paragraph',
}],
})
this.editor.setContent(doc)
Most helpful comment
You can do something like this: