X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fenterkey%2Fplugin.js;h=59a4f8226bc8cc6f7079f903b48427ade1a37daa;hp=d9626a5b9c44695c51338121eb9bdbc6ec32cc70;hb=f0610347140239143439a511ee2bd48cb784f470;hpb=4e70ea24db840898be8cc21c950363a52a2a6aba diff --git a/_source/plugins/enterkey/plugin.js b/_source/plugins/enterkey/plugin.js index d9626a5..59a4f82 100644 --- a/_source/plugins/enterkey/plugin.js +++ b/_source/plugins/enterkey/plugin.js @@ -58,8 +58,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license } } // Don't split
 if we're in the middle of it, act as shift enter key.
-			else if ( !atBlockEnd && block && block.is( 'pre' ) )
+			else if ( block && block.is( 'pre' ) )
+			{
+				if ( !atBlockEnd )
+				{
+					enterBr( editor, mode, range, forceMode );
+					return;
+				}
+			}
+			// Don't split caption blocks. (#7944)
+			else if ( block && CKEDITOR.dtd.$captionBlock[ block.getName() ] )
+			{
 				enterBr( editor, mode, range, forceMode );
+				return;
+			}
 
 			// Determine the block element to be used.
 			var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
@@ -129,8 +141,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 					{
 						// Otherwise, duplicate the previous block.
 						newBlock = previousBlock.clone();
-						// Value attribute of list item should not be duplicated (#7330).
-						newBlock.is( 'li' ) && newBlock.removeAttribute( 'value' );
 					}
 				}
 				else if ( nextBlock )
@@ -180,6 +190,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 				if ( !newBlock.getParent() )
 					range.insertNode( newBlock );
 
+				// list item start number should not be duplicated (#7330), but we need
+				// to remove the attribute after it's onto the DOM tree because of old IEs (#7581).
+				newBlock.is( 'li' ) && newBlock.removeAttribute( 'value' );
+
 				// This is tricky, but to make the new block visible correctly
 				// we must select it.
 				// The previousBlock check has been included because it may be