@tiptap/core 2.5.4 → 2.5.5

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
@@ -579,7 +579,7 @@ const getTextContentFromNodes = ($from, maxMatch = 500) => {
579
579
  }))
580
580
  || node.textContent
581
581
  || '%leaf%';
582
- textBefore += chunk.slice(0, Math.max(0, sliceEndPos - pos));
582
+ textBefore += node.isAtom ? chunk : chunk.slice(0, Math.max(0, sliceEndPos - pos));
583
583
  });
584
584
  return textBefore;
585
585
  };
@@ -4208,6 +4208,11 @@ class Editor extends EventEmitter {
4208
4208
  }
4209
4209
  const state = this.state.apply(transaction);
4210
4210
  const selectionHasChanged = !this.state.selection.eq(state.selection);
4211
+ this.emit('beforeTransaction', {
4212
+ editor: this,
4213
+ transaction,
4214
+ nextState: state,
4215
+ });
4211
4216
  this.view.updateState(state);
4212
4217
  this.emit('transaction', {
4213
4218
  editor: this,