Skip to content

Commit

Permalink
fix(core): use correct position for getMarksBetween (#5412)
Browse files Browse the repository at this point in the history
  • Loading branch information
nperez0111 authored Aug 5, 2024
1 parent e143fb4 commit efb27fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/real-kiwis-double.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion packages/core/src/helpers/getMarksBetween.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit efb27fa

Please sign in to comment.