@tiptap/core 2.7.2 → 2.7.4

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
@@ -342,6 +342,7 @@ function mergeAttributes(...objects) {
342
342
 
343
343
  function getRenderedAttributes(nodeOrMark, extensionAttributes) {
344
344
  return extensionAttributes
345
+ .filter(attribute => attribute.type === nodeOrMark.type.name)
345
346
  .filter(item => item.attribute.rendered)
346
347
  .map(item => {
347
348
  if (!item.attribute.renderHTML) {
@@ -4431,6 +4432,12 @@ class Editor extends EventEmitter {
4431
4432
  destroy() {
4432
4433
  this.emit('destroy');
4433
4434
  if (this.view) {
4435
+ // Cleanup our reference to prevent circular references which caused memory leaks
4436
+ // @ts-ignore
4437
+ const dom = this.view.dom;
4438
+ if (dom && dom.editor) {
4439
+ delete dom.editor;
4440
+ }
4434
4441
  this.view.destroy();
4435
4442
  }
4436
4443
  this.removeAllListeners();