@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.js CHANGED
@@ -4212,6 +4212,10 @@ class NodePos {
4212
4212
  const isBlock = node.isBlock && !node.isTextblock;
4213
4213
  const isNonTextAtom = node.isAtom && !node.isText;
4214
4214
  const targetPos = this.pos + offset + (isNonTextAtom ? 0 : 1);
4215
+ // Check if targetPos is within valid document range
4216
+ if (targetPos < 0 || targetPos > this.resolvedPos.doc.nodeSize - 2) {
4217
+ return;
4218
+ }
4215
4219
  const $pos = this.resolvedPos.doc.resolve(targetPos);
4216
4220
  if (!isBlock && $pos.depth <= this.depth) {
4217
4221
  return;