1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-01 11:12:42 +02:00

docs(concepts): include normalizing inline default behavior (#3637)

Signed-off-by: irmerk <jolenelanglinais@gmail.com>
This commit is contained in:
Jolene Langlinais
2020-04-24 11:28:21 -04:00
committed by GitHub
parent c04672b1f7
commit 970c2aac13
2 changed files with 4 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ But in certain cases, like for links, you might want to make them "inline" flowi
> 🤖 This is a concept borrowed from the DOM's behavior, see [Block Elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements) and [Inline Elements](https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements).
You can define which nodes are treated as inline nodes by overriding the `editor.isInline` function. (By default it always returns `false`.)
You can define which nodes are treated as inline nodes by overriding the `editor.isInline` function. (By default it always returns `false`.) Note that inline nodes cannot be the first or last child of a parent block, nor can it be next to another inline node in the children array. Slate will automatically space these with `{ text: '' }` children by default with [`normalizeNode`](https://docs.slatejs.org/concepts/10-normalizing#built-in-constraints).
Elements can either contain block elements as children. Or they can contain inline elements intermingled with text nodes as children. But elements **cannot** contain some children that are blocks and some that are inlines.