@tiptap/core 2.22.0 → 2.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -4210,6 +4210,10 @@
4210
4210
  const isBlock = node.isBlock && !node.isTextblock;
4211
4211
  const isNonTextAtom = node.isAtom && !node.isText;
4212
4212
  const targetPos = this.pos + offset + (isNonTextAtom ? 0 : 1);
4213
+ // Check if targetPos is within valid document range
4214
+ if (targetPos < 0 || targetPos > this.resolvedPos.doc.nodeSize - 2) {
4215
+ return;
4216
+ }
4213
4217
  const $pos = this.resolvedPos.doc.resolve(targetPos);
4214
4218
  if (!isBlock && $pos.depth <= this.depth) {
4215
4219
  return;