1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-27 17:09:53 +02:00
This commit is contained in:
Brian Kim
2017-12-29 13:48:28 -05:00
committed by Ian Storm Taylor
parent 0e33c8bb35
commit 6f5f2db271
2 changed files with 29 additions and 1 deletions

View File

@@ -1351,7 +1351,7 @@ Changes.wrapInlineAtRange = (change, range, inline, options = {}) => {
const startNode = inline.regenerateKey()
const endNode = inline.regenerateKey()
change.insertNodeByKey(startBlock.key, startIndex - 1, startNode, { normalize: false })
change.insertNodeByKey(startBlock.key, startIndex + 1, startNode, { normalize: false })
change.insertNodeByKey(endBlock.key, endIndex, endNode, { normalize: false })
startInlines.forEach((child, i) => {

View File

@@ -0,0 +1,28 @@
/** @jsx h */
import h from '../../helpers/h'
export default function (value) {
return value
.change()
.wrapInline('hashtag')
.value
.change()
.undo()
.value
}
export const input = (
<value>
<document>
<paragraph>
wo<anchor />rd
</paragraph>
<paragraph>
an<focus />other
</paragraph>
</document>
</value>
)
export const output = input