Browsed by
Tag: Javascript

Drupal: How to turn off automatic enclosing <p> tags in CKEditor

Drupal: How to turn off automatic enclosing <p> tags in CKEditor

Using my previous post on how to turn of the automatic paragraph tags in CKEditor, I knew how to shut this feature off but I didn’t know where. vim sites/all/libraries/ckeditor/config.js Then add this to the config section: CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = ‘fr’; // config.uiColor = ‘#AADC6E’; CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR; }; Save and refresh the page.

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