docs: add new examples to the node schema documentation

This commit is contained in:
Hans Pagel 2021-01-11 15:39:06 +01:00
parent 15ebae2bc7
commit 9491537804

View File

@ -80,9 +80,12 @@ The content attribute defines exactly what kind of content the node can have. Pr
```js ```js
Node.create({ Node.create({
// must have one ore more blocks // must have one or more blocks
content: 'block+', content: 'block+',
// must have zero or more blocks
content: 'block*',
// allows all kinds of 'inline' content (text or hard breaks) // allows all kinds of 'inline' content (text or hard breaks)
content: 'inline*', content: 'inline*',
@ -91,10 +94,12 @@ Node.create({
// can have one or more paragraphs, or lists (if lists are used) // can have one or more paragraphs, or lists (if lists are used)
content: '(paragraph|list?)+', content: '(paragraph|list?)+',
// must have exact one heading at the top, and one or more blocks below
content: 'heading block+'
}) })
``` ```
#### Marks #### Marks
You can define which marks are allowed inside of a node with the `marks` setting of the schema. Add a one or more names or groups of marks, allow all or disallow all marks like this: You can define which marks are allowed inside of a node with the `marks` setting of the schema. Add a one or more names or groups of marks, allow all or disallow all marks like this: