Ticket #5668: 5668_2.patch

File 5668_2.patch, 2.0 KB (added by Garry Yao, 14 years ago)
  • editor/_source/classes/fckdataprocessor.js

     
    101101        {
    102102                var data = FCKXHtml.GetXHTML( rootNode, !excludeRoot, format ) ;
    103103
    104                 if ( ignoreIfEmptyParagraph && FCKRegexLib.EmptyOutParagraph.test( data ) )
    105                         return '' ;
    106 
     104                if ( ignoreIfEmptyParagraph )
     105                        data = data.replace( FCKRegexLib.EmptyOutParagraph, '' );
    107106                return data ;
    108107        },
    109108
  • editor/_source/internals/fckxhtml.js

     
    147147
    148148FCKXHtml._AppendChildNodes = function( xmlNode, htmlNode, isBlockElement )
    149149{
    150         var oNode = htmlNode.firstChild ;
    151 
    152         while ( oNode )
     150        // To defense any possibly IE DOM (due to invalid HTML), where the sibling references are
     151        // unreliable, the safest way is to to traverse through child nodes.
     152        for ( var i = 0, oNode, length = htmlNode.childNodes.length; i < length; i++ )
    153153        {
     154                oNode = htmlNode.childNodes[ i ];
    154155                this._AppendNode( xmlNode, oNode ) ;
    155                 oNode = oNode.nextSibling ;
    156156        }
    157157
    158158        // Trim block elements. This is also needed to avoid Firefox leaving extra
  • editor/_source/internals/fckregexlib.js

     
    6363// Empty elements may be <p></p> or even a simple opening <p> (see #211).
    6464EmptyParagraph  : /^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/ ,
    6565
    66 EmptyOutParagraph : /^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*|&nbsp;|&#160;)(<\/\1>)?$/ ,
     66EmptyOutParagraph : /<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*|&nbsp;|&#160;)(<\/\1>)?$/ ,
    6767
    6868TagBody                 : /></ ,
    6969
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy