mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-01 03:11:44 +02:00
Rollback getTexts
to use a recursive method
This commit is contained in:
@@ -937,7 +937,11 @@ const Node = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
getTexts() {
|
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