Posts

Showing posts with the label quill

How to escape existing content of a div with Quill?

Image
Clash Royale CLAN TAG #URR8PPP How to escape existing content of a div with Quill? I don't use ngQuill or anything like that. I can instanciate a quill editor with this code ctrl.containerElement = $element[0].querySelector('.js-textarea'); ctrl.editor = new Quill(ctrl.containerElement, { theme: 'bubble', modules: { toolbar: toolbarOptions } }); And I registered a custom blot to allow my users to put uiTag (a custom component) inside this editor. It works well. But if my container element contains uiTag before the instanciation, it throw an error : <div class="c-ui-content-editable__textarea js-textarea"> <b>Hi chicken</b>oijzdiojzoijzd <p> <ui-tag color="'secondary'"> <s-label>firstName lastName</s-label> </ui-tag> </p> </div> The error is TypeError: Cannot read property 'childNodes' ...