From 949153780430b64a80559007d1c3886bda94beda Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Mon, 11 Jan 2021 15:39:06 +0100 Subject: [PATCH] docs: add new examples to the node schema documentation --- docs/src/docPages/api/schema.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/src/docPages/api/schema.md b/docs/src/docPages/api/schema.md index 22d101a8..abf216cc 100644 --- a/docs/src/docPages/api/schema.md +++ b/docs/src/docPages/api/schema.md @@ -80,9 +80,12 @@ The content attribute defines exactly what kind of content the node can have. Pr ```js Node.create({ - // must have one ore more blocks + // must have one or more blocks content: 'block+', + // must have zero or more blocks + content: 'block*', + // allows all kinds of 'inline' content (text or hard breaks) content: 'inline*', @@ -91,10 +94,12 @@ Node.create({ // can have one or more paragraphs, or lists (if lists are used) content: '(paragraph|list?)+', + + // must have exact one heading at the top, and one or more blocks below + content: 'heading block+' }) ``` - #### 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: