@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.cjs CHANGED
@@ -1220,8 +1220,10 @@ function getTextBetween(startNode, range, options) {
1220
1220
  range,
1221
1221
  });
1222
1222
  }
1223
+ // do not descend into child nodes when there exists a serializer
1224
+ return false;
1223
1225
  }
1224
- else if (node.isText) {
1226
+ if (node.isText) {
1225
1227
  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
1226
1228
  separated = false;
1227
1229
  }
@@ -3213,7 +3215,7 @@ const Keymap = Extension.create({
3213
3215
  const { selection, doc } = tr;
3214
3216
  const { empty, $anchor } = selection;
3215
3217
  const { pos, parent } = $anchor;
3216
- const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor;
3218
+ const $parentPos = $anchor.parent.isTextblock && pos > 0 ? tr.doc.resolve(pos - 1) : $anchor;
3217
3219
  const parentIsIsolating = $parentPos.parent.type.spec.isolating;
3218
3220
  const parentPos = $anchor.pos - $anchor.parentOffset;
3219
3221
  const isAtStart = (parentIsIsolating && $parentPos.parent.childCount === 1)