Skip to content

Commit

Permalink
Force filter.enterMode==BR for blockless editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Feb 19, 2013
1 parent a4beade commit b1e3afd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@
/**
* Enter mode used by filter when deciding how to strip disallowed elements.
*
* For editor's filter will be equal to {@link CKEDITOR.config#enterMode}.
* For standalone filter will be set to {@link CKEDITOR#ENTER_P} by default.
* For editor's filter it will be set to {@link CKEDITOR.config#enterMode} unless this
* is a blockless (see {@link CKEDITOR.editor#blockless}) editor - in this case
* {@link CKEDITOR#ENTER_BR} will be forced.
*
* For standalone filter it will be by default set to {@link CKEDITOR#ENTER_P}.
*
* @property {CKEDITOR.ENTER_P/CKEDITOR.ENTER_DIV/CKEDITOR.ENTER_BR}
*/
Expand Down Expand Up @@ -83,7 +86,8 @@
if ( !allowedContent )
this.customConfig = false;

this.enterMode = enterMode = editor.config.enterMode;
// Force ENTER_BR for blockless editable.
this.enterMode = enterMode = ( editor.blockless ? CKEDITOR.ENTER_BR : editor.config.enterMode );

this.allow( 'br ' + ( enterMode == CKEDITOR.ENTER_P ? 'p' : enterMode == CKEDITOR.ENTER_DIV ? 'div' : '' ), 'default', 1 );
this.allow( allowedContent, 'config', 1 );
Expand Down

0 comments on commit b1e3afd

Please sign in to comment.