Search code examples
quillreact-quill

QuillJS preview is not as editor view- formatting issue


i am using react quill editor and the editor is working fine. but when i display the html content its not in the format shown in editor view. in console i can see that ql-indent class was applied to tag but its not working outside editor. i tried applying quill core.css styles but still no use.

It's difficult to find a guide on displaying quill-editor html content outside the editor. so please help me in handing ql-xxxx classes outside editor.

enter image description here


Solution

  • i fixed it by adding ql-editor class to the preview div tag.

    <div className="ql-editor" dangerouslySetInnerHTML={{__html: htmlContent}} />