From e280a02597d15460fce97a7555f91ff04926f0e7 Mon Sep 17 00:00:00 2001 From: Sven Adlung Date: Wed, 6 Jul 2022 12:01:23 +0200 Subject: [PATCH] fix(core): only respect text of node before current position (#2937) (#2941) --- packages/core/src/helpers/getTextContentFromNodes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/helpers/getTextContentFromNodes.ts b/packages/core/src/helpers/getTextContentFromNodes.ts index a0d54530e..343d37852 100644 --- a/packages/core/src/helpers/getTextContentFromNodes.ts +++ b/packages/core/src/helpers/getTextContentFromNodes.ts @@ -9,7 +9,7 @@ export const getTextContentFromNodes = ($from: ResolvedPos, maxMatch = 500) => { (node, pos, parent, index) => { textBefore += node.type.spec.toText?.({ node, pos, parent, index, - }) || node.textContent || '%leaf%' + }) || $from.nodeBefore?.text || '%leaf%' }, )