W3C home > Mailing lists > Public > html-tidy@w3.org > January to March 2004

RE: "commented" CDATA for <style>!

From: Jelks Cabaniss <jelks@jelks.nu>
Date: Thu, 12 Feb 2004 18:02:56 -0500
To: <html-tidy@w3.org>
Message-ID: <000601c3f1bc$5a2b7910$6501a8c0@blackie>

Bjoern Hoehrmann wrote:
>> Any chance for an option to *not* wrap the <style> section in
>> "commented" CDATA sections?  There are no '<' or '&' characters
>> needed in any version of CSS.  It would be sooo much nicer to have
>> just a plain 
>> 
>>  <style type="text/css">
>> 
>>  </style>
>> 
>> instead of the grotesque
>> 
>>  <style type="text/css">
>>  /*<![CDATA[*/
>> 
>>  /*]]>*/
>>  </style>
>> 
>> currently emitted with XHTML output.
> 
> Yes... Long standing issue, see http://tinyurl.com/2yham if you like.
> It is however possible that style elements include <, & or ]]>, a
> reference to a background image generated by a server side script, in
> generated content or comments for example. The current escape code is
> in pprint.c, it should be moved to clean.c and probably needs a
> rewrite to address several bugs listed in the bug tracker. Patches
> most welcome! (as are concrete proposals for configuration options).

A lack of competency and familiarity preclude patches, but as for a
concerete proposal, how about something like:

	style-comment :  yes | no | auto
	script-comment:  yes | no | auto

(i.e., "AutoBool").  "auto" would test for the presence of '<' or '&' within
the pertinent content.

I don't have a strong opinion either way as to what the defaults should be.
If the general approach is to remain backwards-compatible with older Tidy
versions (and head off the inevitable "Hey, what happened to my commented
CDATA?" at the pass), they should be "yes" for both.  

Otherwise use "auto" for <style> (I initially thought it should be "no", but
after reading your message, I concede the rare case), and either "auto" or
"yes" for <script> -- probably "yes", because there's a likely probability
of post-Tidy edits of <script> sections.

What do you think?


/Jelks
Received on Thursday, 12 February 2004 18:03:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:53 UTC