Index: _source/plugins/htmldataprocessor/plugin.js
===================================================================
--- _source/plugins/htmldataprocessor/plugin.js (revision 6192)
+++ _source/plugins/htmldataprocessor/plugin.js (revision )
@@ -40,22 +40,27 @@
function blockNeedsExtension( block, fromSource )
{
+ var lastChild = lastNoneSpaceChild( block );
+
+ // Creating padding node for nested blocks.
+ if ( fromSource && lastChild
+ && lastChild.name in CKEDITOR.dtd.$block
+ && block.name in CKEDITOR.dtd.$blockLimit )
+ {
+ return true;
+ }
+
// 1. For IE version >=8, empty blocks are displayed correctly themself in wysiwiyg;
// 2. For the rest, at least table cell and list item need no filler space.
// (#6248)
- if ( fromSource && CKEDITOR.env.ie &&
+ if ( fromSource && CKEDITOR.env.ie &&
( document.documentMode > 7
|| block.name in CKEDITOR.dtd.tr
|| block.name in CKEDITOR.dtd.$listItem ) )
return false;
- var lastChild = lastNoneSpaceChild( block );
-
return !lastChild
- || lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.name == 'br'
- // Some of the controls in form needs extension too,
- // to move cursor at the end of the form. (#4791)
- || block.name == 'form' && lastChild.name == 'input';
+ || lastChild.type == CKEDITOR.NODE_ELEMENT && lastChild.name == 'br';
}
function extendBlockForDisplay( block )
Index: _source/plugins/enterkey/plugin.js
===================================================================
--- _source/plugins/enterkey/plugin.js (revision 6192)
+++ _source/plugins/enterkey/plugin.js (revision )
@@ -31,31 +31,37 @@
var doc = range.document;
+ var atBlockStart = range.checkStartOfBlock(),
+ atBlockEnd = range.checkEndOfBlock(),
+ path = new CKEDITOR.dom.elementPath( range.startContainer ),
+ block = path.block || path.blockLimit;
+
// Exit the list when we're inside an empty list item block. (#5376)
- if ( range.checkStartOfBlock() && range.checkEndOfBlock() )
+ if ( atBlockStart && atBlockEnd && block && ( block.is( 'li' ) || block.getParent().is( 'li' ) ) )
{
- var path = new CKEDITOR.dom.elementPath( range.startContainer ),
- block = path.block;
-
- if ( block && ( block.is( 'li' ) || block.getParent().is( 'li' ) ) )
- {
- editor.execCommand( 'outdent' );
- return;
- }
+ editor.execCommand( 'outdent' );
+ return;
+ }
+ // Exit from block limits when enter pressed at end.
+ else if ( atBlockEnd && block.getName() in CKEDITOR.dtd.$blockLimit )
+ {
+ range.moveToPosition( block, CKEDITOR.POSITION_AFTER_END );
+ range.select();
+ return;
}
// Determine the block element to be used.
var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
- // Split the range.
- var splitInfo = range.splitBlock( blockTag );
+ // Split the range.
+ var splitInfo = range.splitBlock( blockTag );
- if ( !splitInfo )
- return;
+ if ( !splitInfo )
+ return;
- // Get the current blocks.
+ // Get the current blocks.
var previousBlock = splitInfo.previousBlock,
- nextBlock = splitInfo.nextBlock;
+ nextBlock = splitInfo.nextBlock;
var isStartOfBlock = splitInfo.wasStartOfBlock,
isEndOfBlock = splitInfo.wasEndOfBlock;
@@ -335,7 +341,7 @@
return true;
}
else
- return enter( editor, editor.config.shiftEnterMode, 1 );
+ return enter( editor, editor.config.shiftEnterMode, 1 );
}
function enter( editor, mode, forceMode )
Index: _source/core/dtd.js
===================================================================
--- _source/core/dtd.js (revision 6015)
+++ _source/core/dtd.js (revision )
@@ -78,7 +78,7 @@
* @type Object
* @example
*/
- $blockLimit : { body:1,div:1,td:1,th:1,caption:1,form:1 },
+ $blockLimit : { body:1,div:1,td:1,th:1,caption:1,form:1, blockquote: 1 },
/**
* List of inline (<span> like) elements.
Index: _source/plugins/wysiwygarea/plugin.js
===================================================================
--- _source/plugins/wysiwygarea/plugin.js (revision 6192)
+++ _source/plugins/wysiwygarea/plugin.js (revision )
@@ -21,7 +21,8 @@
// Elements that could have empty new line around, including table, pre-formatted block, hr, page-break. (#6554)
function nonExitable( element )
{
- return ( element.getName() in nonExitableElementNames )
+ return element.getName() in CKEDITOR.dtd.$blockLimit
+ || ( element.getName() in nonExitableElementNames )
|| element.isBlockBoundary() && CKEDITOR.dtd.$empty[ element.getName() ];
}