Ticket #6662: 6662.patch
File 6662.patch, 3.2 KB (added by , 13 years ago) |
---|
-
_source/plugins/pastefromword/filter/default.js
184 184 isListBulletIndicator : function( element ) 185 185 { 186 186 var styleText = element.attributes && element.attributes.style; 187 if ( /mso-list\s*:\s*Ignore/i.test( styleText ) )187 if ( !CKEDITOR.env.gecko && /mso-list\s*:\s*Ignore/i.test( styleText ) ) 188 188 return true; 189 // Search for following structure in Gecko `P.class > SPAN > SPAN > SPAN`. 190 else if ( CKEDITOR.env.gecko && element.parent.attributes && 191 /\b(ListParagraph(CxSp\w+)?|MsoNormal\b)/i.test( element.parent.attributes[ 'class' ] ) && 192 element.children && element.children.length == 1 && element.children[ 0 ].name == 'span' && 193 element.children[ 0 ].children && element.children[ 0 ].children.length == 1 && 194 element.children[ 0 ].children[ 0 ].type == 3 195 ) 196 return true; 189 197 }, 190 198 191 199 isContainingOnlySpaces : function( element ) … … 214 222 // Text-indent is not representing list item level any more. 215 223 [ 'text-indent' ], 216 224 [ 'line-height' ], 225 226 [ 'list-style-type' ], 217 227 // Resolve indent level from 'margin-left' value. 218 228 [ ( /^margin(:?-left)?$/ ), null, function( margin ) 219 229 { … … 399 409 ] )( listItemAttrs.style ) 400 410 || '' ); 401 411 402 if ( !list )412 if ( !list || ( list && list.name != listType ) ) 403 413 { 404 414 list = new CKEDITOR.htmlParser.element( listType ); 405 415 list.add( listItem ); … … 867 877 868 878 // For IE/Safari: List item bullet type is supposed to be indicated by 869 879 // the text of a span with style 'mso-list : Ignore' or an image. 870 if ( !CKEDITOR.env.gecko && isListBulletIndicator( element ) ) 880 // For Gecko, list bullet is a child of `p.ListParagraphCxSp*` element. 881 if ( ( !CKEDITOR.env.gecko && isListBulletIndicator( element ) ) || 882 ( CKEDITOR.env.gecko && isListBulletIndicator( element ) ) ) 871 883 { 872 var listSymbolNode = element.firstChild( function( node ) 873 { 874 return node.value || node.name == 'img'; 875 }); 876 877 var listSymbol = listSymbolNode && ( listSymbolNode.value || 'l.' ), 878 listType = listSymbol.match( /^([^\s]+?)([.)]?)$/ ); 884 var listSymbol, listType; 885 if ( CKEDITOR.env.gecko ) 886 { 887 listType = element.children[ 0 ].children[ 0 ].value; 888 listType = /^(?: [ \n]?)*([\w\u00B7]*)(\.?)/.exec( listType ); 889 } 890 else 891 { 892 var listSymbolNode = element.firstChild( function( node ) 893 { 894 return node.value || node.name == 'img'; 895 }); 896 897 listSymbol = listSymbolNode && ( listSymbolNode.value || 'l.' ), 898 listType = listSymbol.match( /^([^\s]+?)([.)]?)$/ ); 899 } 879 900 return createListBulletMarker( listType, listSymbol ); 880 901 } 881 902 … … 971 992 // Preserve clear float style. 972 993 [ ( /^clear$/ ) ], 973 994 995 [ ( /^list-style-type/ ) ], 996 974 997 [ ( /^border.*|margin.*|vertical-align|float$/ ), null, 975 998 function( value, element ) 976 999 {