diff --git a/blots/block.js b/blots/block.js index 239dc4823e..457f46f970 100644 --- a/blots/block.js +++ b/blots/block.js @@ -123,8 +123,8 @@ class Block extends Parchment.Block { this.cache = {}; } - optimize() { - super.optimize(); + optimize(context) { + super.optimize(context); this.cache = {}; } diff --git a/blots/inline.js b/blots/inline.js index 24afe626af..e0c81196b2 100644 --- a/blots/inline.js +++ b/blots/inline.js @@ -29,8 +29,8 @@ class Inline extends Parchment.Inline { } } - optimize() { - super.optimize(); + optimize(context) { + super.optimize(context); if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { let parent = this.parent.isolate(this.offset(), this.length()); diff --git a/formats/bold.js b/formats/bold.js index 7d51d0b106..8ddad6de39 100644 --- a/formats/bold.js +++ b/formats/bold.js @@ -9,8 +9,8 @@ class Bold extends Inline { return true; } - optimize() { - super.optimize(); + optimize(context) { + super.optimize(context); if (this.domNode.tagName !== this.statics.tagName[0]) { this.replaceWith(this.statics.blotName); } diff --git a/formats/code.js b/formats/code.js index c1630fc8e5..fff023589f 100644 --- a/formats/code.js +++ b/formats/code.js @@ -81,16 +81,16 @@ class CodeBlock extends Block { } } - optimize() { + optimize(context) { if (!this.domNode.textContent.endsWith('\n')) { this.appendChild(Parchment.create('text', '\n')); } - super.optimize(); + super.optimize(context); let next = this.next; if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { - next.optimize(); + next.optimize(context); next.moveChildren(this); next.remove(); } diff --git a/formats/list.js b/formats/list.js index 12b1b51850..8b168e5d8c 100644 --- a/formats/list.js +++ b/formats/list.js @@ -96,8 +96,8 @@ class List extends Container { } } - optimize() { - super.optimize(); + optimize(context) { + super.optimize(context); let next = this.next; if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName &&