clearNodes command
The clearNodes command normalizes nodes to the default node, which is the paragraph by default. Itβll even normalize all kind of lists. For advanced use cases it can come in handy, before applying a new node type.
If you wonder how you can define the default node: It depends on whatβs in the content attribute of your Document, by default thatβs block+ (at least one block node) and the Paragraph node has the highest priority, so itβs loaded first and is therefore the default node.
Use the clearNodes command
editor.commands.clearNodes()