Skip to content

Commit

Permalink
parchment no longer using string
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Feb 28, 2018
1 parent 9d40dcf commit 2f2b61d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion blots/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions blots/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 {
Expand Down Expand Up @@ -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;

0 comments on commit 2f2b61d

Please sign in to comment.