Paritosh
Paritosh

Reputation: 4503

summernote line breaks v0.8.8

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?

Upvotes: 3

Views: 6241

Answers (2)

Pawan Verma
Pawan Verma

Reputation: 1269

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

Upvotes: 2

Sultanos
Sultanos

Reputation: 463

The answer to this question is at this link by summernote breakline paragraph to br

all credit to Ghylt

Upvotes: 1

Related Questions