reactjsreact-quill

How to prevent react-quill to insert a new line before list when re-loading content?


Using react-quill, I write a list within text, store the content into external storage, reload the content into quill: a new <br> is inserted before the list, and it happens on each reload.
Any idea what is happening, and how to prevent it?

I prepared a minimal sandbox to show the issue: https://codesandbox.io/s/reverent-cookies-m5h3x
The steps to reproduce:


Solution

  • Found this answer by mhdhamouday in Quill GitHub Issues. This works for me.

    var quill = new Quill('.quill', {
        theme: 'snow',
        modules: {
            toolbar : [...]
            clipboard: {
                matchVisual: false
            }
        }
    });