mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-11 17:53:59 +02:00
Fix normalization to join adjacent text nodes
This commit is contained in:
@@ -982,6 +982,7 @@ const Node = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Join a node by `key` with another `withKey`.
|
* Join a node by `key` with another `withKey`.
|
||||||
|
* It brings Node<key> after Node<WithKey>
|
||||||
*
|
*
|
||||||
* @param {String} key
|
* @param {String} key
|
||||||
* @param {String} withKey
|
* @param {String} withKey
|
||||||
|
@@ -112,7 +112,7 @@ const NO_ADJACENT_TEXT_RULE = {
|
|||||||
normalize: (transform, node, pairs) => {
|
normalize: (transform, node, pairs) => {
|
||||||
return pairs.reduce((t, pair) => {
|
return pairs.reduce((t, pair) => {
|
||||||
const [ first, second ] = pair
|
const [ first, second ] = pair
|
||||||
return t.joinNodeByKey(first.key, second.key)
|
return t.joinNodeByKey(second.key, first.key)
|
||||||
}, transform)
|
}, transform)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user