[Seaside-dev] Make use of CDATA wrapping optional?

Johan Brichau johan at inceptive.be
Sun Apr 13 16:06:42 UTC 2014


Hi there,

The contents of script tags generated in Seaside are by-default wrapped with CDATA tags.
This used to be required to generate valid xhtml [1].

In html5, they can be used but they can also be safely omitted [2] (which is generally the preferred way in html5).

When using a framework like React.js with JSX templates [3], it is even required to omit the CDATA tag. 
The comments inside the script are interpreted by the framework and it does not seem to handle it well when there is the CDATA tag.

As I'm experimenting with a React wrapper for Seaside and I am wondering what the best strategy can be:
- omit CDATA for all script tags being generated on an html5 document
- allow to specifically omit the CDATA tag on a script tag
- inversely: allow to enforce the CDATA tag on a script tag

My preference would be that Seaside automatically omits the CDATA tag when it's in html5 mode (which is the default mode since 3.1), with an option to turn it on for a specific script.
Any thoughts?

Johan

[1] http://javascript.about.com/library/blxhtml.htm
[2] http://stackoverflow.com/questions/3302648/should-i-use-cdata-in-html5
[3] http://facebook.github.io/react/


More information about the seaside-dev mailing list