1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 09:29:49 +02:00

add test for joining forward on inline voids

This commit is contained in:
Ian Storm Taylor
2016-11-29 16:21:18 -08:00
parent 083df2dd93
commit ff5e67e63f
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
export default function (state) {
const { document, selection } = state
const texts = document.getTexts()
const first = texts.first()
const range = selection.merge({
anchorKey: first.key,
anchorOffset: first.length,
focusKey: first.key,
focusOffset: first.length
})
return state
.transform()
.deleteForwardAtRange(range)
.apply()
}

View File

@@ -0,0 +1,17 @@
nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: emoji
isVoid: true
- kind: text
text: ""

View File

@@ -0,0 +1,12 @@
nodes:
- kind: block
type: paragraph
nodes:
- kind: text
text: ""
- kind: inline
type: emoji
isVoid: true
- kind: text
text: ""