1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-03 04:02:33 +02:00

docs: Create a Text section in Node docs

This commit is contained in:
Sunny Hirai
2021-03-29 23:28:19 -07:00
parent 1f9bf19e3b
commit 5cf31eb423

View File

@@ -90,6 +90,14 @@ Options: `{from?: Path, to?: Path, reverse?: boolean, pass?: (node: NodeEntry =>
Get the parent of a node at a specific `path`.
### Text methods
Methods related to Text.
###### `Node.string(root: Node): string`
Get the concatenated text string of a node's content. Note that this will not include spaces or line breaks between block nodes. This is not intended as a user-facing string, but as a string for performing offset-related computations for a node.
###### `Node.texts(root: Node, options?): Generator<NodeEntry<Text>>`
Return a generator of all leaf text nodes in a root node.
@@ -111,9 +119,3 @@ Check if a `value` implements the `Node` interface.
###### `Node.isNodeList(value: any): value is Node[]`
Check if a `value` is a list of `Node` objects.
### Other method
###### `Node.string(root: Node): string`
Get the concatenated text string of a node's content. Note that this will not include spaces or line breaks between block nodes. This is not intended as a user-facing string, but as a string for performing offset-related computations for a node.