pressing enter at the end of line already having br tag for new line will keep the br tag + add the p tags
See original GitHub issueDescription of your Issue :
It seems like if user will try to add new line with enter at the line break already introduced with shift+enter the editor will not remove the br but introduce p tags as would one expect. this will result in bigger space between rows.
steps to reproduce (Add more if necessary):
- open https://summernote.org/
- type : abcd , shift + enter, abcd
- arrow up (or click at the beginning of first row)
- press enter
What is your Operating System, Browser and Version and Summernote Version you are using:
This can help find and resolve any issues, place an x inside the brackets or if relevant elaborate after each choice.
-
Operating System: [x] Microsoft Windows [ ] Apple [ ] Linux [ ] All
-
Browser and Version: [ ] Brave [x] Chrome 96.0.4664.45 (Official Build) (64-bit) [ ] Edge [x] Firefox 94.0.1 [ ] Internet Explorer [ ] Opera [ ] Safari [ ] Other (Specify):
-
Summernote Version, place an x inside the brackets: [ ] BS3 [ ] BS4 [ ] Lite [x] All
screenshot of issue
Chrome :
code view :
code in editor :
<p>abcd</p><p><br>abcd</p>
FF :
code view :
code in editor :
<p>abcd</p><p><br>abcd</p>
just for fun I tested different editors, it seems kendo will remove the br tag (tested here) but syncfusion (https://ej2.syncfusion.com/javascript/demos/rich-text-editor/tools/) and ckeditor (https://ckeditor.com/ckeditor-5/demo/) will behave exactly as summernote.
is this something you will look into?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Well, the use of the
execCommand()
function that Browsers allow access to, as Lothar mentioned is considered deprecated, so eventually, if Summernote is to stay around as a viable editor needs to change how it manipulates DOM Elements. It’s been discussed on different posts, and we all agree something needs to be implemented at some point. First I would like to see Summernote drop jQuery as a dependency, but there are features in the jQuery API that we use, and are difficult to implement in native Javascript.Yes, Dennis. SummerNote works together with native editing features. Therefore, results are browser-dependent.
There are many discussions about using
<br>
- for example here: https://stackoverflow.com/questions/1726073/is-it-sometimes-bad-to-use-br