From f4d3bbd5eca77fdf49afd1873eab254c592a5023 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Thu, 8 Apr 2021 22:56:09 +0200 Subject: [PATCH] docs: update content --- docs/src/docPages/api/commands/clear-nodes.md | 4 +++- docs/src/docPages/guide/extend-extensions.md | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/src/docPages/api/commands/clear-nodes.md b/docs/src/docPages/api/commands/clear-nodes.md index ebf6ed0c..5c71faaf 100644 --- a/docs/src/docPages/api/commands/clear-nodes.md +++ b/docs/src/docPages/api/commands/clear-nodes.md @@ -1,5 +1,7 @@ # clearNodes -The `clearNodes` command normalizes nodes to a simple paragraph, it even normalizes all kind of lists. For advanced use cases it can come in handy, before applying a new node type. +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`](/api/nodes/document), by default that’s `block+` (at least one block node) and the [`Paragraph`](/api/nodes/paragraph) node has the highest priority, so it’s loaded first and is therefore the default node. ## Usage ```js diff --git a/docs/src/docPages/guide/extend-extensions.md b/docs/src/docPages/guide/extend-extensions.md index f1be0efe..1a91f23e 100644 --- a/docs/src/docPages/guide/extend-extensions.md +++ b/docs/src/docPages/guide/extend-extensions.md @@ -40,7 +40,7 @@ The extension name is used in a whole lot of places and changing it isn’t too The extension name is also part of the JSON. If you [store your content as JSON](/guide/output#option-1-json), you need to change the name there too. ### Priority -With the priority you can specify the order of the extensions. This has an impact on the schema and ProseMirror plugins. Default priority is `100`. A higher value means that the extension will be loaded earlier. +The priority defines the order in which extensions are registered. The default priority is `100`, that’s what most extension have. Extensions with a higher priority will be loaded earlier. ```js import Link from '@tiptap/extension-link' @@ -50,6 +50,10 @@ const CustomLink = Link.extend({ }) ``` +The order in which extensions are loaded influences a few things. + +For example the output. The [`Link`](/api/marks/link) mark has a higher priority, which means it’ll be rendered as `Example` instead of `Example`. + ### Settings All settings can be configured through the extension anyway, but if you want to change the default settings, for example to provide a library on top of tiptap for other developers, you can do it like that: