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

Implement "wrapInlineByKey" and use it in "wrapInlineAtRange"

This commit is contained in:
Samy Pessé
2016-12-02 14:05:45 +01:00
parent 238ed2b3ab
commit 797b58e5c5
8 changed files with 97 additions and 5 deletions

View File

@@ -60,6 +60,7 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S
- [`unwrapInlineByKey`](#unwrapinlinebykey)
- [`unwrapBlockByKey`](#unwrapblockbykey)
- [`wrapBlockByKey`](#wrapblockbykey)
- [`wrapInlineByKey`](#wrapinlinebykey)
- [Document Transforms](#document-transforms)
- [`deleteAtRange`](#deleteatrange)
- [`deleteBackwardAtRange`](#deletebackwardatrange)
@@ -338,6 +339,12 @@ Unwrap all inner content of a [`Block`](./block.md) node that match `properties`
Wrap the given node in a [`Block`](./block.md) node that match `properties`. For convenience, you can pass a `type` string or `properties` object.
### `wrapInlineByKey`
`wrapInlineByKey(key: String, properties: Object) => Transform` <br/>
`wrapInlineByKey(key: String, type: String) => Transform`
Wrap the given node in a [`Inline`](./inline.md) node that match `properties`. For convenience, you can pass a `type` string or `properties` object.
## Document Transforms
### `deleteBackwardAtRange`