Ticket #2163: 2163_2.patch

File 2163_2.patch, 2.1 KB (added by Alfonso Martínez de Lizarrondo, 12 years ago)

Revised patch

  • _whatsnew.html

     
    4141                now use sampleposteddata.php in action parameter inside a form.</li>
    4242                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2150">#2150</a>] The searching
    4343                        speed of the Find/Replace dialog has been vastly improved.</li>
     44                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2163">#2163</a>] If the FCKConfig.DocType
     45                        setting points to a HTML DocType then the output won't generate self-closing tags (it will output
     46                        &lt;img &gt; instead of &lt;img /&gt;).</li>
    4447        </ul>
    4548        <p>
    4649                Fixed Bugs:</p>
  • editor/_source/internals/fckregexlib.js

     
    7878
    7979Html4DocType    : /HTML 4\.0 Transitional/i ,
    8080DocTypeTag              : /<!DOCTYPE[^>]*>/i ,
     81HtmlDocType             : /DTD HTML/ ,
    8182
    8283// These regex are used to save the original event attributes in the HTML.
    8384TagsWithEvent   : /<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g ,
  • 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 && FCKRegexLib.HtmlDocType.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