[TYPO3-core] RFC: Bug 1477 and 3013 - xhtml_cleaning corrupts javascript

Michael Stucki michael at typo3.org
Fri Sep 8 08:43:44 CEST 2006


Hi Franz,

>> >> Without knowing the code of the HTML cleaner. Why look for CDATA and
>> >> not for the script element. Inside <script> nothing should be checked,
>> >> wheter enclosed by a CDATA declaration (?) or not.
>> > 
>> > Same for <style>. However if <script> and <style> use CDATA declaration
>> > (as they should!) patch should work.
>> 
>> Why should? After all its a cleaning function. So in fact xhtml_cleaning
>> should ADD it if it's missing instead of relying on its presence.

I agree with Masi.

> I think no TYPO3 specific code should be inserted with xhtml_cleaning.

Prove me wrong, but this is not TYPO3 specific code :-)

> However it is possible to write another function
> 'javascript_cdata_inserter' which could add those CDATA things. But the
> exension author should iniitiate this by himself.

If the extension author knew about CDATA then he would add them from the
beginning, hence he wouldn't need such a function at all.

This is what TSref writes about config.xhtml_cleaning:

--- cut ---
Tries to clean up the output to make it XHTML compliant and a bit more.
THIS IS NOT COMPLETE YET, but a ?pilot? to see if it makes sense
anyways. For now this is what is done:
What it does at this point:
- All tags (img,br,hr) is ended with "/>" - others?
- Lowercase for elements and attributes
- All attributes in quotes
- Add "alt" attribute to img-tags if it's not there already.
--- cut ---

Rest is cut off.

There is nothing wrong with adding those CDATA parts if they are missing, so
please follow Masis suggestion which is exactly what the user expects from
such a feature.

Thanks!
- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/



More information about the TYPO3-team-core mailing list