X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fenterkey%2Fplugin.js;h=c7e8d4e8c944fcc47b52e3b8d6b6c960a7d8440d;hp=59a4f8226bc8cc6f7079f903b48427ade1a37daa;hb=e73319a12b56100b29ef456fd74114fe5519e01c;hpb=f0610347140239143439a511ee2bd48cb784f470 diff --git a/_source/plugins/enterkey/plugin.js b/_source/plugins/enterkey/plugin.js index 59a4f82..c7e8d4e 100644 --- a/_source/plugins/enterkey/plugin.js +++ b/_source/plugins/enterkey/plugin.js @@ -48,14 +48,31 @@ For licensing, see LICENSE.html or http://ckeditor.com/license path = new CKEDITOR.dom.elementPath( range.startContainer ), block = path.block; - // Exit the list when we're inside an empty list item block. (#5376) if ( atBlockStart && atBlockEnd ) { + // Exit the list when we're inside an empty list item block. (#5376) if ( block && ( block.is( 'li' ) || block.getParent().is( 'li' ) ) ) { editor.execCommand( 'outdent' ); return; } + + if ( block && block.getParent().is( 'blockquote' ) ) + { + block.breakParent( block.getParent() ); + + // If we were at the start of
, there will be an empty element before it now. + if ( !block.getPrevious().getFirst( CKEDITOR.dom.walker.invisible(1) ) ) + block.getPrevious().remove(); + + // If we were at the end of
, there will be an empty element after it now. + if ( !block.getNext().getFirst( CKEDITOR.dom.walker.invisible(1) ) ) + block.getNext().remove(); + + range.moveToElementEditStart( block ); + range.select(); + return; + } } // Don't split
 if we're in the middle of it, act as shift enter key.
 			else if ( block && block.is( 'pre' ) )
@@ -386,11 +403,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 		setTimeout( function()
 			{
 				editor.fire( 'saveSnapshot' );	// Save undo step.
+
 				if ( mode == CKEDITOR.ENTER_BR )
 					enterBr( editor, mode, null, forceMode );
 				else
 					enterBlock( editor, mode, null, forceMode );
 
+				editor.fire( 'saveSnapshot' );
+
 			}, 0 );
 
 		return true;