Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Parchment] Cannot insert emojiBlot into block #146

Closed
Protocteur opened this issue Nov 8, 2021 · 0 comments
Closed

[Parchment] Cannot insert emojiBlot into block #146

Protocteur opened this issue Nov 8, 2021 · 0 comments

Comments

@Protocteur
Copy link

I got this error when i select an emoji to add in my content :

[Parchment] Cannot insert emojiBlot into block

I'm running this module with quill v1.3.7, and i saw the error come from parchment.js :

ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function (child) { return childBlot instanceof child; })) { throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); } childBlot.insertInto(this, refBlot); };

In this method, the childBlot (emojiBlot in that case) doesn't return true when the instance is compared to EmbedBlot (that came from allowedChildren)

So i think the issue came from by the way emojiBlot extend Embed (that came from quill, and not from Parchment like in quill core modules, like Image ..)

So ... i fixed the issue and the PR is coming soon ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant