Changeset 2022 for FCKeditor/trunk


Ignore:
Timestamp:
05/28/2008 10:17:53 PM (6 years ago)
Author:
alfonsoml
Message:

Fix for #2163, enable output of HTML (not XHTML) according to the DocType.

Location:
FCKeditor/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/_whatsnew.html

    r2019 r2022  
    4949 
    5050                 
     51                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2163">#2163</a>] If the FCKConfig.DocType 
     52                        setting points to a HTML DocType then the output won't generate self-closing tags (it will output  
     53                        &lt;img &gt; instead of &lt;img /&gt;).</li> 
    5154        </ul> 
    5255        <p> 
  • FCKeditor/trunk/editor/_source/internals/fckregexlib.js

    r1565 r2022  
    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. 
  • FCKeditor/trunk/editor/_source/internals/fckxhtml.js

    r1920 r2022  
    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 ) 
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy