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

Johan Brichau johan at inceptive.be
Mon Apr 14 08:25:17 UTC 2014


On 14 Apr 2014, at 10:08, Philippe Marschall <philippe.marschall at gmail.com> wrote:

>> 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.
> 
> That sounds like a bug in react.

That's true, but while digging I noticed it was not something that is going to be used anymore in html5 _and_ Seaside does it by default without possibility to alter it.

>> 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?
> 
> I don't know if anybody ever used XHTML and served it in a way to be
> parsed as XML. I don't think anybody will in the future. So it may be
> best to just get rid of this clever hack..

So, I guess you agree with making it default when rendering html5? 

I think it's still good to have it around. I can remember we used to render in xhtml mode before there was proper support to embed svg in html5. I still remember the horrible bugs we encountered rendering certain characters on the page in things like a title attribute... So, yes, we probably did use it ;-)

I don't know yet if my suggestion can be easily implemented, but I will take a look at it.

Johan


More information about the seaside-dev mailing list