Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

summernote line breaks v0.8.8

Tags:

summernote

I'm having an issue i've seen others post about, using the Enter key is causing an extra line break to appear. Now I know I can use shift + enter, but i can't except my users to know that.

Is there a fix for this? I've using v0.8.8, I saw this: https://github.com/summernote/summernote/issues/546#issuecomment-341518461

but this did not work, i saw another post using $.summernote.addPlugin({ but .addPlugin does not work in v0.8.8 anymore.

Was anyone able to get around this?

like image 835
Paritosh Avatar asked Dec 19 '25 07:12

Paritosh


1 Answers

You can use the following code to change the functionality of Enter

$('#summernote').summernote().on("summernote.enter", function(we, e) {
  $(this).summernote('pasteHTML', '<br>&VeryThinSpace;');
  e.preventDefault();
});

It's works for me. Ref:- Github

like image 69
Pawan Verma Avatar answered Dec 22 '25 05:12

Pawan Verma



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!