/*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
path = new CKEDITOR.dom.elementPath( range.startContainer ),\r
block = path.block;\r
\r
- // Exit the list when we're inside an empty list item block. (#5376)\r
if ( atBlockStart && atBlockEnd )\r
{\r
+ // Exit the list when we're inside an empty list item block. (#5376)\r
if ( block && ( block.is( 'li' ) || block.getParent().is( 'li' ) ) )\r
{\r
editor.execCommand( 'outdent' );\r
return;\r
}\r
+\r
+ if ( block && block.getParent().is( 'blockquote' ) )\r
+ {\r
+ block.breakParent( block.getParent() );\r
+\r
+ // If we were at the start of <blockquote>, there will be an empty element before it now.\r
+ if ( !block.getPrevious().getFirst( CKEDITOR.dom.walker.invisible(1) ) )\r
+ block.getPrevious().remove();\r
+\r
+ // If we were at the end of <blockquote>, there will be an empty element after it now.\r
+ if ( !block.getNext().getFirst( CKEDITOR.dom.walker.invisible(1) ) )\r
+ block.getNext().remove();\r
+\r
+ range.moveToElementEditStart( block );\r
+ range.select();\r
+ return;\r
+ }\r
}\r
// Don't split <pre> if we're in the middle of it, act as shift enter key.\r
else if ( block && block.is( 'pre' ) )\r
\r
isPre = ( startBlockTag == 'pre' );\r
\r
- // Gecko prefers <br> as line-break inside <pre> (#4711).\r
- if ( isPre && !CKEDITOR.env.gecko )\r
- lineBreak = doc.createText( CKEDITOR.env.ie ? '\r' : '\n' );\r
+ // IE<8 prefers text node as line-break inside of <pre> (#4711).\r
+ if ( startBlockTag == 'pre' && CKEDITOR.env.ie && CKEDITOR.env.version < 8 )\r
+ lineBreak = doc.createText( '\r' );\r
else\r
lineBreak = doc.createElement( 'br' );\r
\r
setTimeout( function()\r
{\r
editor.fire( 'saveSnapshot' ); // Save undo step.\r
+\r
if ( mode == CKEDITOR.ENTER_BR )\r
enterBr( editor, mode, null, forceMode );\r
else\r
enterBlock( editor, mode, null, forceMode );\r
\r
+ editor.fire( 'saveSnapshot' );\r
+\r
}, 0 );\r
\r
return true;\r