1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 18:39:51 +02:00

Rollback getTexts to use a recursive method

This commit is contained in:
Samy Pessé
2016-11-03 12:15:33 +01:00
parent 663522139c
commit bf66749c4d

View File

@@ -937,7 +937,11 @@ const Node = {
*/
getTexts() {
return this.filterDescendants(node => node.kind == 'text')
return this.nodes.reduce((texts, node) => {
return node.kind == 'text'
? texts.push(node)
: texts.concat(node.getTexts())
}, List())
},
/**