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:
@@ -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())
|
||||
},
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user