Changeset 525

Show
Ignore:
Timestamp:
2007-07-25 03:55:38 (17 months ago)
Author:
martinkou
Message:

Fixed #404 : Line breaks within <pre> tags are incorrectly converted to <br> tags in Firefox.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fckxhtml.js

    r524 r525  
    174174                // Element Node. 
    175175                case 1 : 
     176                        // If we detect a <br> inside a <pre> in Gecko, turn it into a line break instead. 
     177                        // This is a workaround for the Gecko bug here: https://bugzilla.mozilla.org/show_bug.cgi?id=92921 
     178                        if ( FCKBrowserInfo.IsGecko  
     179                                        && htmlNode.tagName.toLowerCase() == 'br'  
     180                                        && htmlNode.parentNode.tagName.toLowerCase() == 'pre' ) 
     181                        { 
     182                                var val = '\r' ; 
     183                                if ( htmlNode == htmlNode.parentNode.firstChild ) 
     184                                        val += '\r' ; 
     185                                return FCKXHtml._AppendNode( xmlNode, this.XML.createTextNode( val ) ) ; 
     186                        } 
    176187 
    177188                        // Here we found an element that is not the real element, but a 
     
    399410                        var val = item.nodeValue ; 
    400411                        if ( item.nodeType == 3 && i == 0 ) 
    401                                 node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( "\r\n" + val ) ) ) ; 
     412                                node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( '\r\n' + val ) ) ) ; 
    402413                        else 
    403414                                FCKXHtml._AppendNode( node, item ) ;