Ticket #2163: 2163.patch

File 2163.patch, 943 bytes (added by Alfonso Martínez de Lizarrondo, 12 years ago)

Proposed SVN patch

  • editor/_source/internals/fckxhtml.js

     
    7070        // Strip the "XHTML" root node.
    7171        sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).Trim() ;
    7272
    73         // Add a space in the tags with no closing tags, like <br/> -> <br />
    74         sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />');
     73        // According to the doctype set the proper end for self-closing tags
     74        // HTML: <br>
     75        // XHTML: Add a space, like <br/> -> <br />
     76        if (FCKConfig.DocType.length > 0 && /DTD HTML/.test( FCKConfig.DocType ) )
     77                sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, '>');
     78        else
     79                sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />');
    7580
    7681        if ( FCKConfig.ForceSimpleAmpersand )
    7782                sXHTML = sXHTML.replace( FCKRegexLib.ForceSimpleAmpersand, '&' ) ;
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy