zenoamaro / react-quill

A Quill component for React.
https://zenoamaro.github.io/react-quill
MIT License
6.77k stars 923 forks source link

indent not working when displaying text inside dangerouslySetInnerHTML #671

Open maximegheraille opened 4 years ago

maximegheraille commented 4 years ago

When using react-quill and displaying the editor's code inside dangerouslySetInnerHTML, the indentation does not work

Here is the code : https://codesandbox.io/s/condescending-pasteur-pohse?fontsize=14&hidenavigation=1&theme=dark

Ticket due diligence

ReactQuill version

kokiebisu commented 3 years ago

I am having the same issue as well.

React-quill: ^1.3.5

JamesonBozeman commented 3 years ago

ReactQuill is using their own classes to handle indentation. i.e. ql-indent-1 Adding the class "ql-editor" to the dangerouslySetInnerHTML element or a parent element should allow these indentation styles to apply. These classes are part of quill.snow.css.

naveenpandiselvam commented 1 year ago

ReactQuill is using their own classes to handle indentation. i.e. ql-indent-1 Adding the class "ql-editor" to the dangerouslySetInnerHTML element or a parent element should allow these indentation styles to apply. These classes are part of quill.snow.css.

<Typography className="ql-editor" variant="h5regular" id={"Description"} dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(Description), }}

tonyng3101 commented 2 months ago

ReactQuill is using their own classes to handle indentation. i.e. ql-indent-1 Adding the class "ql-editor" to the dangerouslySetInnerHTML element or a parent element should allow these indentation styles to apply. These classes are part of quill.snow.css.

This is the right answer. Saving my time. Thank you vr much!!

sudanbasyal commented 2 months ago

ReactQuill is using their own classes to handle indentation. i.e. ql-indent-1 Adding the class "ql-editor" to the dangerouslySetInnerHTML element or a parent element should allow these indentation styles to apply. These classes are part of quill.snow.css.

Thanks, this is the right answer anyone facing the same issue!