docs: update content

This commit is contained in:
Hans Pagel
2021-04-08 22:56:09 +02:00
parent f3b91bc27b
commit f4d3bbd5ec
2 changed files with 8 additions and 2 deletions

View File

@@ -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. 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`](/api/nodes/document), by default thats `block+` (at least one block node) and the [`Paragraph`](/api/nodes/paragraph) node has the highest priority, so its loaded first and is therefore the default node.
## Usage
```js

View File

@@ -40,7 +40,7 @@ The extension name is used in a whole lot of places and changing it isnt 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`, thats 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 itll be rendered as `<a href="…"><strong>Example</strong></a>` instead of `<strong><a href="…">Example</></strong>`.
### 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: