Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Summernote pastHTML add unwanted extra lines.

Tags:

summernote

I am loading user input back into summernote for editing, both top and bottom get extra lines added on. Is there a way to fix it?

$('#summernote').summernote('editor.pasteHTML', "<p>hello world</p>");

comes out

"

hello world

"

instead of "hello world"

like image 614
user6306977 Avatar asked Mar 01 '26 01:03

user6306977


1 Answers

I ran into the same problem. If you're trying to initialize the editor with html, try doing $('#summernote').summernote('code', "<p>hello world</p>"); instead. The $('#summernote').summernote('code', markupString); is for setting the html directly.

like image 164
Paul Hazelton Avatar answered Mar 06 '26 22:03

Paul Hazelton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!