tiptap/docs/api/commands/clear-nodes.md
2021-09-16 14:41:25 +02:00

614 B
Raw Blame History

clearNodes

The clearNodes command normalizes nodes to the default node, which is the paragraph by default. Itll 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 whats in the content attribute of your Document, by default thats block+ (at least one block node) and the Paragraph node has the highest priority, so its loaded first and is therefore the default node.

Usage

editor.commands.clearNodes()