Last active
December 6, 2018 09:11
-
-
Save saw/1d4d76ec49c5ae0649d0063fca57c908 to your computer and use it in GitHub Desktop.
Blots to fix the IME issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Quill from 'quill'; | |
let Text = Quill.import('blots/text'); | |
class TextBlot extends Text { | |
static create(value) { | |
if (!value) { | |
value = '\u200B'; | |
} | |
return document.createTextNode(value); | |
} | |
} | |
let Block = Quill.import('blots/block'); | |
Block.defaultChild = 'text'; | |
Quill.register('blots/text', Text); | |
Quill.register('blots/block', Block); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 16 should be: Quill.register('blots/text', TextBlot);