From c5164cc346a7b8c2e2bf912d2364d6c4901b7493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20de=20Juvigny?= Date: Wed, 13 Dec 2023 14:41:16 +0100 Subject: [PATCH] use contat --- src/Block.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Block.tsx b/src/Block.tsx index e423f10..823ce53 100644 --- a/src/Block.tsx +++ b/src/Block.tsx @@ -22,11 +22,11 @@ const augmentProps = (content: Node) => { const getPlainText = (children: typeof childrenNodes): string => { return children.reduce((currentPlainText, node) => { if (node.type === 'text') { - return currentPlainText + node.text; + return currentPlainText.concat(node.text); } if (node.type === 'link') { - return currentPlainText + getPlainText(node.children); + return currentPlainText.concat(getPlainText(node.children)); } return currentPlainText;