Ticket #5455: 5455_5.patch
File 5455_5.patch, 2.2 KB (added by , 13 years ago) |
---|
-
_source/core/dom/element.js
850 850 : 851 851 function() 852 852 { 853 var attributes = this.$.attributes; 854 return ( attributes.length > 1 || ( attributes.length == 1 && attributes[0].nodeName != '_cke_expando' ) ); 853 var attrs = this.$.attributes, 854 attrsNum = attrs.length, 855 // The _moz_dirty attribute might get into the element after pasting (#5455) 856 execludeAttrs = { _cke_expando : 1, _moz_dirty : 1 }; 857 if ( attrsNum == 1 && execludeAttrs[ attrs[0].nodeName ] ) 858 return false; 859 else if ( attrsNum == 2 && execludeAttrs[ attrs[0].nodeName ] && execludeAttrs[ attrs[1].nodeName ] ) 860 return false; 861 return attrsNum > 0; 855 862 }, 856 863 857 864 /** -
_source/plugins/styles/plugin.js
1030 1030 { 1031 1031 // Removing elements may open points where merging is possible, 1032 1032 // so let's cache the first and last nodes for later checking. 1033 var firstChild = element.getFirst();1034 var lastChild= element.getLast();1033 var firstChild = element.getFirst(), 1034 lastChild = element.getLast(); 1035 1035 1036 1036 element.remove( true ); 1037 1037 … … 1041 1041 firstChild.type == CKEDITOR.NODE_ELEMENT && firstChild.mergeSiblings(); 1042 1042 1043 1043 if ( lastChild && !firstChild.equals( lastChild ) 1044 && lastChild.type == CKEDITOR.NODE_ELEMENT 1044 && lastChild.type == CKEDITOR.NODE_ELEMENT ) 1045 1045 lastChild.mergeSiblings(); 1046 1046 } 1047 1047 } 1048 // We intend to remove the element while still have attributes left on it, 1049 // migrate them it into a span (without additional semantics) element instead. 1050 else 1051 { 1052 var replacement = new CKEDITOR.dom.element( 'span' ); 1053 element.copyAttributes( replacement, { _cke_expando : 1, _moz_dirty : 1 } ); 1054 element.moveChildren( replacement ); 1055 replacement.replace( element ); 1056 replacement.mergeSiblings(); 1057 } 1048 1058 } 1049 1059 1050 1060 function getElement( style, targetDocument )