fix: do not consider text content as atoms resolve #5405 (#5407)

This commit is contained in:
Nick Perez 2024-07-29 08:54:17 +02:00 committed by GitHub
parent 5fb71f6602
commit a08bf85cf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@tiptap/core": patch
---
This fixes a bug with inputrules not being able to resolve positions properly

View File

@ -24,7 +24,7 @@ export const getTextContentFromNodes = ($from: ResolvedPos, maxMatch = 500) => {
|| node.textContent
|| '%leaf%'
textBefore += node.isAtom ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos))
textBefore += node.isAtom && !node.isText ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos))
},
)