Ticket #6984: 6984.patch

File 6984.patch, 1.9 KB (added by Garry Yao, 13 years ago)
  • _source/core/htmlparser/fragment.js

     
    108108                        }
    109109                }
    110110
    111                 function sendPendingBRs( brsToIgnore )
     111                function sendPendingBRs()
    112112                {
    113                         while ( pendingBRs.length - ( brsToIgnore || 0 ) > 0 )
     113                        while ( pendingBRs.length )
    114114                                currentNode.add( pendingBRs.shift() );
    115115                }
    116116
  • _source/plugins/wysiwygarea/plugin.js

     
    313313                var win = editor.window,
    314314                        doc = editor.document,
    315315                        body = editor.document.getBody(),
     316                        bodyFirstChild = body.getFirst(),
    316317                        bodyChildsNum = body.getChildren().count();
    317318
    318                 if ( !bodyChildsNum || ( bodyChildsNum == 1&& body.getFirst().hasAttribute( '_moz_editor_bogus_node' ) ) )
     319                if ( !bodyChildsNum
     320                        || bodyChildsNum == 1
     321                                && bodyFirstChild.type == CKEDITOR.NODE_ELEMENT
     322                                && bodyFirstChild.hasAttribute( '_moz_editor_bogus_node' ) )
    319323                {
    320324                        restoreDirty( editor );
    321325
     
    981985                                                                                '</html>';
    982986                                                                }
    983987
     988                                                                // Distinguish bogus to normal BR at the end of document for Mozilla. (#5293).
     989                                                                if ( CKEDITOR.env.gecko )
     990                                                                        data = data.replace( /<br \/>(?=\s*<\/(:?html|body)>)/, '$&<br type="_moz" />' );
     991
    984992                                                                data += activationScript;
    985993
    986994
     
    10001008                                                                        ? doc.getDocumentElement().getOuterHtml()
    10011009                                                                        : doc.getBody().getHtml();
    10021010
     1011                                                                // BR at the end of document is bogus node for Mozilla. (#5293).
     1012                                                                if ( CKEDITOR.env.gecko )
     1013                                                                        data = data.replace( /<br>(?=\s*(:?$|<\/body>))/, '' );
     1014
    10031015                                                                if ( editor.dataProcessor )
    10041016                                                                        data = editor.dataProcessor.toDataFormat( data, fixForBody );
    10051017
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy