fix(core): only respect text of node before current position (#2937) (#2941)

This commit is contained in:
Sven Adlung
2022-07-06 12:01:23 +02:00
committed by GitHub
parent 110b5daf0d
commit e280a02597

View File

@@ -9,7 +9,7 @@ export const getTextContentFromNodes = ($from: ResolvedPos, maxMatch = 500) => {
(node, pos, parent, index) => { (node, pos, parent, index) => {
textBefore += node.type.spec.toText?.({ textBefore += node.type.spec.toText?.({
node, pos, parent, index, node, pos, parent, index,
}) || node.textContent || '%leaf%' }) || $from.nodeBefore?.text || '%leaf%'
}, },
) )