Ticket #5528: 5528.patch

File 5528.patch, 1.6 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

basic idea

  • plugins/htmldataprocessor/plugin.js

     
    132132                                                        return false;
    133133
    134134                                                // Remove duplicated attributes - #3789.
    135                                                 var attributeNames = [ 'name', 'href', 'src' ],
     135                                                var attributeNames = [ 'name', 'href', 'src', 'style' ],
    136136                                                        savedAttributeName;
    137137                                                for ( var i = 0 ; i < attributeNames.length ; i++ )
    138138                                                {
     
    230230        for ( i in blockLikeTags )
    231231                defaultHtmlBlockFilterRules.elements[ i ] = extendBlockForOutput;
    232232
    233         if ( CKEDITOR.env.ie )
    234         {
    235                 // IE outputs style attribute in capital letters. We should convert
    236                 // them back to lower case.
    237                 defaultHtmlFilterRules.attributes.style = function( value, element )
    238                 {
    239                         return value.toLowerCase();
    240                 };
    241         }
    242 
    243233        var protectAttributeRegex = /<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;
     234        var protectStyleRegex = /\s(style\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;
    244235
    245236        var protectElementsRegex = /(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
    246237                encodedElementsRegex = /<cke:encoded>([^<]*)<\/cke:encoded>/gi;
     
    252243
    253244        function protectAttributes( html )
    254245        {
    255                 return html.replace( protectAttributeRegex, '$& _cke_saved_$1' );
     246                return html.replace( protectAttributeRegex, '$& _cke_saved_$1' ).replace( protectStyleRegex, '$& _cke_saved_$1' );
    256247        }
    257248
    258249        function protectElements( html )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy