0

Primefaces 6.1 new Text Editor component is using QuillJS 1.22 for rich text editing. Unfortunately this editor is parsing html code in his own way. When I put this in backing bean variable:

<p>a<br>a<br>a</p>

I end up with this:

<p>a</p>
<p><br></p>
<p>a</p>
<p><br></p>
<p>a</p>

Is there option to insert directly html code to an QuillJS editor from Primefaces?

1 Answers1

-2

We can add new function to js code of component:

if(PrimeFaces.widget.TextEditor){
    PrimeFaces.widget.TextEditor = PrimeFaces.widget.TextEditor.extend({
        insertText: function (text){
            this.editor.clipboard.dangerouslyPasteHTML(0, text);
        }
    });
}

but there is no option to put unparsed html code to QuillJS 1.22. For now I had to go back to old Editor component, which support inserting unparsed html code.