1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 04:20:26 +02:00

Fix normalization to join adjacent text nodes

This commit is contained in:
Samy Pesse
2016-10-18 21:50:42 +02:00
parent d4dfdacdc3
commit a49f8e1bfa
2 changed files with 2 additions and 1 deletions

View File

@@ -982,6 +982,7 @@ const Node = {
/**
* Join a node by `key` with another `withKey`.
* It brings Node<key> after Node<WithKey>
*
* @param {String} key
* @param {String} withKey

View File

@@ -112,7 +112,7 @@ const NO_ADJACENT_TEXT_RULE = {
normalize: (transform, node, pairs) => {
return pairs.reduce((t, pair) => {
const [ first, second ] = pair
return t.joinNodeByKey(first.key, second.key)
return t.joinNodeByKey(second.key, first.key)
}, transform)
}
}