pasteHTML auto add unused <p><br></p>
See original GitHub issueBefore submitting an issue, please make sure to search for already open issues, and add to that. This way we can track issues more easily. Thank you, and Thanks for using Summernote.
Description of your Issue or Request:
I want to paste html , but it add many <p><br></p>
.
steps to reproduce (Add more if necessary):
-
go to https://summernote.org/
-
in chrome console exec
$('#summernote').summernote('pasteHTML', '<p>1</p>');
-
in code view
<p><br></p><p>1</p><p><br></p>
, why has<p><br></p>
. Is it has solution not add<p><br></p>
when call pasteHTML method
What is your Operating System, Browser and Version and Summernote Version you are using:
This can help find and resolve any issues.
-
Operating System: Windows 10
-
Browser and Version: Chrome 76.0.3809.100
-
Summernote Version: 0.8.12
-
Bootstrap Version or Lite: bootstrap3
screenshot of issue
Add screenshot which shows your issue(if needed).
You can make gif from Recordit.
If you can make the issue using jsfiddle(https://jsfiddle.net/), We can save time to reproduce the problem.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:33 (8 by maintainers)
Out of about 6 HTML Editors, I choose to evaluate summernote first. I slammed straight into this bug. I tried several workarounds. This is the sort of problem that you would expect to see in an alpha release; not something that appears somewhat mature. So I jumped over to https://quilljs.com/ and go it working and integrated in no time at all.
The method suggested by a few including neil-viralmd and Budsy didn’t work for me, but I got it to work this way:
$("#summernote").summernote("code", htmlString);