Ticket #5487: 5487.patch

File 5487.patch, 1.2 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    1414        var nonExitableElementNames = { table:1,pre:1 };
    1515
    1616        // Matching an empty paragraph at the end of document.
    17         var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi;
     17        var emptyParagraphRegexp = /<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?(\s*)(?=$|<\/body>)/gi;
    1818
    1919        function onInsertHtml( evt )
    2020        {
     
    698698                                                                if ( editor.dataProcessor )
    699699                                                                        data = editor.dataProcessor.toDataFormat( data, fixForBody );
    700700
    701                                                                 // Strip the last blank paragraph within document.
     701                                                                // Strip the last blank paragraph within document while preserve any whitespaces around.
    702702                                                                if ( config.ignoreEmptyParagraph )
    703                                                                         data = data.replace( emptyParagraphRegexp, '' );
     703                                                                        data = data.replace( emptyParagraphRegexp, '$3' );
    704704
    705705                                                                if ( docType )
    706706                                                                        data = docType + '\n' + data;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy