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%' }, )