JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.1
[ckeditor.git] / _source / plugins / list / plugin.js
index 0cd962f..b0d5e8c 100644 (file)
@@ -299,8 +299,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        var contentBlock = listContents.shift(),\r
                                listItem = doc.createElement( 'li' );\r
 \r
-                       // Preserve heading structure when converting to list item. (#5271)\r
-                       if ( headerTagRegex.test( contentBlock.getName() ) )\r
+                       // Preserve preformat block and heading structure when converting to list item. (#5335) (#5271)\r
+                       if ( contentBlock.is( 'pre' ) || headerTagRegex.test( contentBlock.getName() ) )\r
                                contentBlock.appendTo( listItem );\r
                        else\r
                        {\r
@@ -312,13 +312,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                contentBlock.copyAttributes( listItem );\r
                                contentBlock.moveChildren( listItem );\r
                                contentBlock.remove();\r
+\r
+                               // Append a bogus BR to force the LI to render at full height\r
+                               if ( !CKEDITOR.env.ie )\r
+                                       listItem.appendBogus();\r
                        }\r
 \r
                        listItem.appendTo( listNode );\r
-\r
-                       // Append a bogus BR to force the LI to render at full height\r
-                       if ( !CKEDITOR.env.ie )\r
-                               listItem.appendBogus();\r
                }\r
 \r
                if ( dir )\r
@@ -424,7 +424,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                        var paragraph = doc.createElement( editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' :\r
                                                        ( editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'br' ) );\r
                                        paragraph.appendTo( body );\r
-                                       ranges = [ new CKEDITOR.dom.range( doc ) ];\r
+                                       ranges = new CKEDITOR.dom.rangeList( [ new CKEDITOR.dom.range( doc ) ] );\r
                                        // IE exception on inserting anything when anchor inside <br>.\r
                                        if ( paragraph.is( 'br' ) )\r
                                        {\r