Strange handling of several consecutive line breaks (<br><br>)
Describe the bug
The editor formats the inserted HTML very strangely if it uses more than one <br> character in a row
For some reason, the editor leaves only one <br> character out of several in a row.
To Reproduce
- Go to http://suneditor.com/sample/index.html
- Using "Code View" insert UTML:
<div>
Header <br><br>
Line 1<br><br>
Line 2<br><br>
Line 3 <br><br><br>
Footer</div>
- Return to editor mode.
- Insert the cursor, for example, between Line 1 and Line 2
- Press "Enter" key
- Press the "Enter" key again
After point 5. the cursor will jump to the very beginning of the text to the line "Header" After point 6. spaces between lines will be removed, but an empty line will be added at the very top of the text.
In "Code View" we will see this HTML:
<div><br>
</div>
<div>Header <br>
Line 1<br>
Line 2<br>
Line 3 <br>
Footer</div>
Expected behavior After pressing the "Enter" key twice in a row, two empty lines should be added.
Screenshots
It should be like this:
But it turns out like this:
Desktop (please complete the following information):
- OS: Windows 10
- Browser chrome
- Version 123.0.6312.123
Hello @abvas , I'm having the same issue. Did you find any workaround to this?
Hello @g-domingos ! Unfortunately, no one answered me here, and I myself could not solve this problem.
I see. For what I could see, maybe inserting the "< br >" tag between "< p >< / p >" might work. The issue for me have been how to manipulate the html on a custom onPaste function.
Im having troubles pasting from word, since the line breaks disappear when I paste on suneditor.
The closest I got for the same results from the word document it is when I press Ctrl + Shift + V to paste on the Editor, but that causes de
tags and the unusual behaviour you stated.