Ticket #6159: 6159_2.patch
File 6159_2.patch, 2.0 KB (added by , 14 years ago) |
---|
-
_source/plugins/list/plugin.js
34 34 { 35 35 var listItem = listNode.getChild( i ); 36 36 37 // It may be a text node or some funny stuff. 38 if ( listItem.$.nodeName.toLowerCase() != 'li' ) 39 continue; 37 // It may be a text node or some funny stuff. 38 if (listItem.$.nodeName.toLowerCase() != 'li') 39 { 40 // The item might be probably a malformed list. (#6159) 41 if ( listItem.getName() in CKEDITOR.dtd.$list ) 42 { 43 var previousItemObj = baseArray[ baseArray.length - 1 ]; 44 if ( previousItemObj ) 45 previousItemObj.contents.push( listItem ); 46 } 47 continue; 48 } 40 49 41 50 var itemObj = { 'parent' : listNode, indent : baseIndentLevel, element : listItem, contents : [] }; 42 51 if ( !grandparentNode ) … … 55 64 for ( var j = 0, itemChildCount = listItem.getChildCount(), child; j < itemChildCount ; j++ ) 56 65 { 57 66 child = listItem.getChild( j ); 58 if ( child.type == CKEDITOR.NODE_ELEMENT && listNodeNames[ child.getName() ] ) 59 // Note the recursion here, it pushes inner list items with 60 // +1 indentation in the correct order. 61 CKEDITOR.plugins.list.listToArray( child, database, baseArray, baseIndentLevel + 1, itemObj.grandparent ); 62 else 63 itemObj.contents.push( child ); 67 if (child.type == CKEDITOR.NODE_ELEMENT && listNodeNames[ child.getName() ]) 68 // Note the recursion here, it pushes inner list items with 69 // +1 indentation in the correct order. 70 { 71 CKEDITOR.plugins.list.listToArray(child, database, baseArray, baseIndentLevel + 1, itemObj.grandparent); 72 } 73 else 74 itemObj.contents.push(child); 64 75 } 65 76 } 66 77 return baseArray;