mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-27 09:04:31 +02:00
committed by
Ian Storm Taylor
parent
0e33c8bb35
commit
6f5f2db271
@@ -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) => {
|
||||
|
@@ -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
|
Reference in New Issue
Block a user