slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.56k stars 3.38k forks source link

Clipboard.convert adds extra \n when ending with multiple <p></br></p> #672

Closed emanuelbsilva closed 8 years ago

emanuelbsilva commented 8 years ago

The clipboard.convert is adding an extra line break when ending with more than 1<p></br></p>

You can see the code pen i made: http://codepen.io/emanuelbsilva/pen/JXqxYY.

In that scenario when converting: <p>test</p><p><br></p> is returning test\n\n, which is correct. But when converting <p>test</p><p><br></p><p></br></p> is returning test\n\n\n\n, but should return test\n\n\n.

jhchen commented 8 years ago

Quill's clipboard is designed to match input visually. Paragraph tags by default have bottom margin to look like two lines, so Quill interprets them as such. You can customize this if desired: https://quilljs.com/docs/modules/clipboard/

juliantejera commented 7 years ago

In case anybody else runs into this issue, here's the new link of the clipboard module https://quilljs.com/docs/modules/clipboard/

jhchen commented 7 years ago

Thanks @juliantejera I updated my link as well for the skimmers out there