I have a Quill editor that needs to convert certain legacy content, which is already HTML, into the parchment delta format. Putting the HTML into the DOM before creating the Quill editor works perfectly:
<div id="my-editor">
<p>My legacy content</p>
</div>
<script>
var editor = new Quill("#my-editor");
</script>
However, some of the legacy HTML is very messy and contains certain style constructs (font, color, background) that I don't want to support.
Quill does a great job of ignoring tags, classes, and style attributes that it doesn't understand. But I'd like to un-register certain known formats that I want it to also ignore. I've tried doing this...
Quill.register({
'formats/color': null,
'formats/font': null,
'formats/background': null
});
...in an attempt to un-register those formats from the Quill registry. But then I get this error at runtime:
TypeError: Cannot read property 'blotName' of null
at Function.register (vendor/quill-1.3.2.js:1068:82)
Any suggestions?