Skip to content

Commit

Permalink
use contat
Browse files Browse the repository at this point in the history
  • Loading branch information
remidej committed Dec 13, 2023
1 parent 18dd9ab commit c5164cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c5164cc

Please sign in to comment.