Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CKEditor break <div>

CKEditor works great. There is just minor thing which I would like to improve

We have message system which uses CKEditor. The original (old) text is in a with a vertical blue line. See the screenshot:

enter image description here

I would like to break the <div>.

Up to now I found no way to break it.

In my case a RETURN key should break the <div>.

like image 225
guettli Avatar asked Sep 12 '17 09:09

guettli


1 Answers

You can config the enter key with the following modes:

  • ENTER_P – new <p> paragraphs are created;
  • ENTER_BR – lines are broken with <br> elements;
  • ENTER_DIV – new <div> blocks are created.

So in your case, to break a div:

CKEDITOR.replace( 'textarea_id', {
    enterMode: CKEDITOR.ENTER_DIV
});

Here are the docs for ENTER_BR

like image 135
Duc Filan Avatar answered Sep 20 '22 03:09

Duc Filan