user6306977
user6306977

Reputation: 43

Summernote pastHTML add unwanted extra lines.

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"

Upvotes: 3

Views: 1125

Answers (1)

Paul Hazelton
Paul Hazelton

Reputation: 11

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.

Upvotes: 1

Related Questions