Quill inserts a useless line-break before the <ul> element

See original GitHub issue

Unfortunately quill insert a line-break if you paste the following html into the editor:

<p>Simple list:</p><ul><li>item one</li><li>item two</li></ul><p><br></p>

The behavior of pasteHTML() or convert(), setContents() is the same.

Steps for Reproduction

  1. Visit https://codepen.io/iice/pen/vQKrWY
  2. change line in js to var html = <p>Simple list:</p><ul><li>item one</li><li>item two</li></ul><p><br></p>;
  3. Watch what happens in the Viewer

Expected behavior:

Quill should not insert an line-break before the <ul> - because this sums up. The first time it insert a line-break, then we save it, then quill inserts the second line-break, we save again, and so on…

Actual behavior:

Simple list:

  • item one
  • item two

Platforms:

Chrome 79 Windows 10

Version: 1.3.7

Run Quill.version to find out

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:11

github_iconTop GitHub Comments

15reactions
mhdhamoudaycommented, Aug 28, 2020

I fixed it by disabling matchVisual, but I think we should find better solution.

var quill = new Quill('.quill', {
    theme: 'snow',
    modules: {
        toolbar : [...]
        clipboard: {
            matchVisual: false
        }
    }
});
3reactions
peter-elliott-mscommented, Jul 20, 2021

I fixed it by disabling matchVisual, but I think we should find better solution.

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

it a appears as though that was the ultimate solution in later versions of quill: https://github.com/quilljs/quill/commit/3897c981fcabc599ce3b90793a33d40c4fa25fee

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent react-quill to insert a new line before list when ...
write a line, followed by a bullet list · click save to store the content to external storage · click clear to remove...
Read more >
Quill, Shift-Enter and <br> tags
This means that pointless, useless but nevertheless harmless <br> might be hidden in the edited document forever (or until deleted by moving ...
Read more >
react-quill - UNPKG
The CDN for react-quill. ... return this;\n }\n // Since it does not matter if we insert before or after deleting at ......
Read more >
Untitled
2nd ashes test 2013 live streaming, Dragon knight dota 2 item guide, Barba blanca ... Dietetyk krosno ul lewakowskiego, Hp procurve 2610-48 default...
Read more >
Untitled
Captain planet heart useless, Iriya no sora ufo no natsu capitulo 6, Fotoweek dc 2010, ... Sled dogs skis, Periodic table of elements...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found