For some reason, I have to wrap heading
Node in, say section
Node.
The NodeSpec is something like:
heading: {
// copied from prosemirror-schema-basic, but `group: 'block' is removed
},
section: {
content: 'heading',
attrs: {
...
}
...
}
Now I hope everything still works as the basic demo:
- clicking the menu button to turn the current stuff into a heading
-
#
triggers a new heading
But I found it awkward. I tried to wrapIn
the current line in a section node first, and then setBlockType
the attrs for the section node. But it does not work, since the section node can only contains heading
.