question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pasteHTML auto add unused <p><br></p>

See original GitHub issue

Before 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):

  1. go to https://summernote.org/

  2. in chrome console exec $('#summernote').summernote('pasteHTML', '<p>1</p>');

  3. 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.

  1. Operating System: Windows 10

  2. Browser and Version: Chrome 76.0.3809.100

  3. Summernote Version: 0.8.12

  4. Bootstrap Version or Lite: bootstrap3

screenshot of issue

Add screenshot which shows your issue(if needed). image

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:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:33 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
daveapsgithubcommented, Jul 20, 2020

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.

5reactions
elementalpetecommented, Jul 30, 2021

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);

Read more comments on GitHub >

github_iconTop Results From Across the Web

Untitled
update to 1.2.6 - update to 1.2.5 - add more docu - automatic rebuild ... removed older, unused patches - add patch from...
Read more >
Untitled
fix bug 196398 - Enable -D option automatically in initscript if ... SVN to fix a computed-value-not-used warning in kpropd (#684862) - add...
Read more >
other.xml.gz
removed X bits; gnome has a much better X interface for apm anyway - auto ... menu files for .vfolder-info-default - don't install...
Read more >
Untitled
upgrade to 0.81 (strip excludes unused symtable entries, test borked). ... Automatically add and remove DDP services from /etc/services - Placed the ...
Read more >
Untitled
[78] - update to newer auto*/libtool - some more steps towards TLS support, ... removed older, unused patches - add patch from Yukihiro...
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