Ticket #2331 (closed Bug: wontfix)

Opened 5 years ago

Last modified 5 years ago

Content of <script> tags is not wrapped in <![CDATA[...]]>

Reported by: A.M. Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.6.2
Keywords: Cc:

Description

FCKeditor is supposed to output XHTML, but it fails to wrap content of <script> and <style> tags in CDATA sections. This is how a <script> tag should be generated in XHTML:

    <script type="text/javascript">
    <![CDATA[
    var a = "This is a line break: <br/>";
    ]]>
    </script>

See the XHTML specification for details:

http://www.w3.org/TR/xhtml1/#h-4.8

Lack of CDATA sections screws up any XSLT transformations performed against the generated XHTML.

Change History

comment:1 Changed 5 years ago by alfonsoml

  • Keywords XHTML CDATA script removed
  • Status changed from new to closed
  • Resolution set to wontfix

FCKeditor doesn't create by itself the script or style tags, it must be done with a plugin or directly in source mode. In any case it would be the responsibility of the author to put those tags if his backend system does require them.

That specs points out that the suggested method is to use external scripts and stylesheets: http://www.w3.org/TR/xhtml1/#C_4

The only way to do it in FCKeditor would be to run a regexp against the contents of those nodes (every time that the content is serialized), I think that it's far from ideal and prone to errors.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy