Ticket #3977: 3977_2.patch

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

     
    801801                                                if ( match.length == 1 )        // one space, preserve it
    802802                                                        return ' ' ;
    803803                                                else if ( offset == 0 )         // beginning of block
    804                                                         return CKEDITOR.tools.replace( ' ', match.length - 1 ) + ' ';
     804                                                        return CKEDITOR.tools.repeat( ' ', match.length - 1 ) + ' ';
    805805                                                else                            // end of block
    806                                                         return ' ' + CKEDITOR.tools.replace( ' ', match.length - 1 );
     806                                                        return ' ' + CKEDITOR.tools.repeat( ' ', match.length - 1 );
    807807                                        } ) ;
    808808
    809809                        // 3. Convert \n to <BR>.
     
    812812                         blockHtml =  blockHtml.replace( /[ \t]{2,}/g,
    813813                                        function ( match )
    814814                                        {
    815                                                 return CKEDITOR.tools.replace( '&nbsp;', match.length - 1 ) + ' ' ;
     815                                                return CKEDITOR.tools.repeat( '&nbsp;', match.length - 1 ) + ' ' ;
    816816                                        } ) ;
    817817
    818818                        var newBlockClone = newBlock.clone()Index: _source/tests/core/tools.html
  • _source/tests/core/tools.html

     
    154154                        assert.areSame( 'silver', clone.cars.Porsche.color );
    155155                },
    156156
    157                 test_multiple : function()
     157                test_replace : function()
    158158                {
    159159                        assert.areSame( '&nbsp;&nbsp;&nbsp;', CKEDITOR.tools.replace( '&nbsp;', 3 ) );
    160160                },
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy