Summernote insert single line break instead of paragraph on pressing enter

I’ve seen a variety of discussions about this and none of them quite worked for me, so here is my version – working on the current (0.8.9) version.

$("#summernote").summernote({
//your options
}).on("summernote.enter", function(we, e) {
$(this).summernote("pasteHTML", "<br><br>");
e.preventDefault();
});

We intercept the enter key, insert 2 breaks (required for new line) and prevent it from continuing to the insertPara function.

Tagged , , , , . Bookmark the permalink.

2 Responses to Summernote insert single line break instead of paragraph on pressing enter

  1. kent says:

    thank you so much. this works perfectly for me.

  2. seyha says:

    it’s works perfectly for me , thanks

Leave a Reply

Your email address will not be published. Required fields are marked *