fix(core): use correct position for getMarksBetween (#5412)

This commit is contained in:
Nick Perez 2024-08-05 20:46:23 +02:00 committed by GitHub
parent e143fb4ca3
commit efb27faf54
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 discrepency between `getMarksBetween` and `isActive(markName)` where the position used for getMarksBetween was off by one

View File

@ -12,7 +12,7 @@ export function getMarksBetween(from: number, to: number, doc: ProseMirrorNode):
.resolve(from)
.marks()
.forEach(mark => {
const $pos = doc.resolve(from - 1)
const $pos = doc.resolve(from)
const range = getMarkRange($pos, mark.type)
if (!range) {