CkEditor paragraphs and brakes

CkEditor paragraphs and brakes

We use CkEditor here at work as our default wysiwyg editor. To overcome 2 annoying things (in my opinion) you can use the following tricks.

$(function() {
    CKEDITOR.config.autoParagraph = false;
    CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
    CKEDITOR.config.shiftEnterMode = CKEDITOR.ENTER_BR;

This piece of code will:

  • Prevent the adding of a P tag around the whole text
  • Render carriage return as a brake instead of a P tag

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.