JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.1
[ckeditor.git] / _source / plugins / enterkey / plugin.js
index d9626a5..59a4f82 100644 (file)
@@ -58,8 +58,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                }\r
                        }\r
                        // Don't split <pre> if we're in the middle of it, act as shift enter key.\r
-                       else if ( !atBlockEnd && block && block.is( 'pre' ) )\r
+                       else if ( block && block.is( 'pre' ) )\r
+                       {\r
+                               if ( !atBlockEnd )\r
+                               {\r
+                                       enterBr( editor, mode, range, forceMode );\r
+                                       return;\r
+                               }\r
+                       }\r
+                       // Don't split caption blocks. (#7944)\r
+                       else if ( block && CKEDITOR.dtd.$captionBlock[ block.getName() ] )\r
+                       {\r
                                enterBr( editor, mode, range, forceMode );\r
+                               return;\r
+                       }\r
 \r
                        // Determine the block element to be used.\r
                        var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );\r
@@ -129,8 +141,6 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        {\r
                                                // Otherwise, duplicate the previous block.\r
                                                newBlock = previousBlock.clone();\r
-                                               // Value attribute of list item should not be duplicated (#7330).\r
-                                               newBlock.is( 'li' ) && newBlock.removeAttribute( 'value' );\r
                                        }\r
                                }\r
                                else if ( nextBlock )\r
@@ -180,6 +190,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                if ( !newBlock.getParent() )\r
                                        range.insertNode( newBlock );\r
 \r
+                               // list item start number should not be duplicated (#7330), but we need\r
+                               // to remove the attribute after it's onto the DOM tree because of old IEs (#7581).\r
+                               newBlock.is( 'li' ) && newBlock.removeAttribute( 'value' );\r
+\r
                                // This is tricky, but to make the new block visible correctly\r
                                // we must select it.\r
                                // The previousBlock check has been included because it may be\r