Whenever the onChange fires, every time it encounters 1 or more paragraphs with line breaks, it adds an even more paragraphs with line breaks to the document.
If you take a look at the codepen below, the initial state only contains a sinlge paragraph with a line break, between the 2 headers.
Inspecting the document reveals 3 of them.
You probably want to add matchVisual: false to the clipboard module config to prevent Quill adding spacing around headings: http://quilljs.com/docs/modules/clipboard/#matchvisual
Be aware that react-quill dependency requirement for quill is lower than v1.3, which is the version that implements matchVisual...
It took me a while to figure that's why it wasn't working. You config it like:
<ReactQuill
modules={{
clipboard: {
matchVisual: false,
},
}}
[...]
/>
@enapupe did you find any way to solve it with react-quill although the lower version it uses?
Yeah I just did yarn remove react-quill and added it back again.
Most helpful comment
Be aware that
react-quilldependency requirement forquillis lower thanv1.3, which is the version that implementsmatchVisual...It took me a while to figure that's why it wasn't working. You config it like: