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

Add another tests for removeTextByKey with inline

This commit is contained in:
Samy Pesse
2016-10-24 23:23:13 +02:00
parent 5ded81e335
commit 684d51e4b6
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
export default function (state) {
const { document, selection } = state
const first = document.getTexts().first()
return state
.transform()
.removeTextByKey(first.key, 0, 1)
.apply()
}

View File

@@ -0,0 +1,13 @@
nodes:
- kind: block
type: paragraph
nodes:
- kind: inline
type: link
nodes:
- kind: inline
type: hashtag
nodes:
- kind: text
text: a

View File

@@ -0,0 +1,7 @@
nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""