Ticket #4512: 4512.patch

File 4512.patch, 1.2 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/styles/plugin.js

     
    8080        var blockElements       = { address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 };
    8181        var objectElements      = { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,ul:1 };
    8282
    83         var semicolonFixRegex = /\s*(?:;\s*|$)/;
     83        var semicolonFixRegex = /\s*(?:;\s*|$)/,
     84                fixSemicolon = function( styleText )
     85                {
     86                        return styleText.replace( semicolonFixRegex, ';' );
     87                };
    8488
    8589        CKEDITOR.style = function( styleDefinition, variablesValues )
    8690        {
     
    264268                var stylesText = ( styleDefinition.attributes && styleDefinition.attributes[ 'style' ] ) || '';
    265269
    266270                if ( stylesText.length )
    267                         stylesText = stylesText.replace( semicolonFixRegex, ';' );
     271                        stylesText = fixSemicolon( stylesText );
    268272
    269273                for ( var style in stylesDef )
    270                         stylesText += style + ':' + stylesDef[ style ] + ';';
     274                        stylesText += fixSemicolon( style + ':' + stylesDef[ style ] );
    271275
    272276                // Browsers make some changes to the style when applying them. So, here
    273277                // we normalize it to the browser format.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy