mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 10:29:48 +02:00
Add pass
option to Editor.nodes
(#5843)
This commit is contained in:
@@ -141,7 +141,7 @@ Options: `depth?: number, edge?: 'start' | 'end'`
|
||||
|
||||
At any given `Location` or `Span` in the editor provided by `at` (default is the current selection), the method returns a Generator of `NodeEntry` objects that represent the nodes that include `at`. At the top of the hierarchy is the `Editor` object itself.
|
||||
|
||||
Options: `{at?: Location | Span, match?: NodeMatch, mode?: 'all' | 'highest' | 'lowest', universal?: boolean, reverse?: boolean, voids?: boolean}`
|
||||
Options: `{at?: Location | Span, match?: NodeMatch, mode?: 'all' | 'highest' | 'lowest', universal?: boolean, reverse?: boolean, voids?: boolean, pass?: (node: NodeEntry => boolean), ignoreNonSelectable?: boolean}`
|
||||
|
||||
`options.match`: Provide a value to the `match?` option to limit the `NodeEntry` objects that are returned.
|
||||
|
||||
@@ -151,6 +151,8 @@ Options: `{at?: Location | Span, match?: NodeMatch, mode?: 'all' | 'highest' | '
|
||||
- `'highest'`: in a hierarchy of nodes, only return the highest level matching nodes
|
||||
- `'lowest'`: in a hierarchy of nodes, only return the lowest level matching nodes
|
||||
|
||||
`options.pass`: Skip the descendants of certain nodes (but not the nodes themselves).
|
||||
|
||||
#### `Editor.parent(editor: Editor, at: Location, options?) => NodeEntry<Ancestor>`
|
||||
|
||||
Get the parent node of a location.
|
||||
|
Reference in New Issue
Block a user