@tiptap/core 2.2.4 → 2.2.6

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
@@ -1216,8 +1216,10 @@ function getTextBetween(startNode, range, options) {
1216
1216
  range,
1217
1217
  });
1218
1218
  }
1219
+ // do not descend into child nodes when there exists a serializer
1220
+ return false;
1219
1221
  }
1220
- else if (node.isText) {
1222
+ if (node.isText) {
1221
1223
  text += (_a = node === null || node === void 0 ? void 0 : node.text) === null || _a === void 0 ? void 0 : _a.slice(Math.max(from, pos) - pos, to - pos); // eslint-disable-line
1222
1224
  separated = false;
1223
1225
  }
@@ -3209,7 +3211,7 @@ const Keymap = Extension.create({
3209
3211
  const { selection, doc } = tr;
3210
3212
  const { empty, $anchor } = selection;
3211
3213
  const { pos, parent } = $anchor;
3212
- const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor;
3214
+ const $parentPos = $anchor.parent.isTextblock && pos > 0 ? tr.doc.resolve(pos - 1) : $anchor;
3213
3215
  const parentIsIsolating = $parentPos.parent.type.spec.isolating;
3214
3216
  const parentPos = $anchor.pos - $anchor.parentOffset;
3215
3217
  const isAtStart = (parentIsIsolating && $parentPos.parent.childCount === 1)