diff --git a/blots/block.js b/blots/block.js index 67c4dfd111..f51e15e92f 100644 --- a/blots/block.js +++ b/blots/block.js @@ -125,7 +125,7 @@ class Block extends Parchment.Block { } Block.blotName = 'block'; Block.tagName = 'P'; -Block.defaultChild = 'break'; +Block.defaultChild = Break; Block.allowedChildren = [Inline, Parchment.Embed, TextBlot]; class BlockEmbed extends Parchment.Embed { diff --git a/blots/scroll.js b/blots/scroll.js index 8fab379fda..55a79b4f31 100644 --- a/blots/scroll.js +++ b/blots/scroll.js @@ -84,7 +84,7 @@ class Scroll extends Parchment.Scroll { def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null ) { - const blot = Parchment.create(this.statics.defaultChild); + const blot = Parchment.create(this.statics.defaultChild.blotName); this.appendChild(blot); if (def == null && value.endsWith('\n')) { blot.insertAt(0, value.slice(0, -1), def); @@ -103,7 +103,7 @@ class Scroll extends Parchment.Scroll { insertBefore(blot, ref) { if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) { - const wrapper = Parchment.create(this.statics.defaultChild); + const wrapper = Parchment.create(this.statics.defaultChild.blotName); wrapper.appendChild(blot); super.insertBefore(wrapper, ref); } else { @@ -176,7 +176,7 @@ class Scroll extends Parchment.Scroll { Scroll.blotName = 'scroll'; Scroll.className = 'ql-editor'; Scroll.tagName = 'DIV'; -Scroll.defaultChild = 'block'; +Scroll.defaultChild = Block; Scroll.allowedChildren = [Block, BlockEmbed, Container]; export default Scroll;