@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.umd.js CHANGED
@@ -1214,8 +1214,10 @@
1214
1214
  range,
1215
1215
  });
1216
1216
  }
1217
+ // do not descend into child nodes when there exists a serializer
1218
+ return false;
1217
1219
  }
1218
- else if (node.isText) {
1220
+ if (node.isText) {
1219
1221
  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
1220
1222
  separated = false;
1221
1223
  }
@@ -3207,7 +3209,7 @@
3207
3209
  const { selection, doc } = tr;
3208
3210
  const { empty, $anchor } = selection;
3209
3211
  const { pos, parent } = $anchor;
3210
- const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor;
3212
+ const $parentPos = $anchor.parent.isTextblock && pos > 0 ? tr.doc.resolve(pos - 1) : $anchor;
3211
3213
  const parentIsIsolating = $parentPos.parent.type.spec.isolating;
3212
3214
  const parentPos = $anchor.pos - $anchor.parentOffset;
3213
3215
  const isAtStart = (parentIsIsolating && $parentPos.parent.childCount === 1)