mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-16 12:14:14 +02:00
fix normalization for inserting inlines and blocks
This commit is contained in:
@@ -258,6 +258,7 @@ export function insertBlockAtRange(transform, range, block) {
|
||||
transform.insertNodeByKey(parent.key, index + 1, block)
|
||||
}
|
||||
|
||||
transform.normalizeDocument()
|
||||
return transform
|
||||
}
|
||||
|
||||
@@ -374,6 +375,7 @@ export function insertInlineAtRange(transform, range, inline) {
|
||||
|
||||
transform.splitNodeByKey(startKey, startOffset)
|
||||
transform.insertNodeByKey(parent.key, index + 1, inline)
|
||||
transform.normalizeDocument()
|
||||
return transform
|
||||
}
|
||||
|
||||
|
@@ -16,9 +16,6 @@ nodes:
|
||||
nodes:
|
||||
- kind: text
|
||||
text: rd
|
||||
- kind: inline
|
||||
type: hashtag
|
||||
nodes:
|
||||
- kind: inline
|
||||
type: link
|
||||
nodes:
|
||||
|
Reference in New Issue
Block a user