#9415 closed defect (bug) (invalid)
TinyMCE breaks <script> tags in XHTML and E4X
| Reported by: | sephr | Owned by: | azaozz |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | TinyMCE | Version: | |
| Severity: | normal | Keywords: | dev-feedback |
| Cc: | Focuses: |
Description
TinyMCE automatically adds <!-- ... --> to <script> tags, effectively commenting out the script for execution in XHTML. If ;e4x=1 is in the type attribute, regardless of if the page is served as XHTML or plain HTML, the script also breaks due to <!--...--> being an XML literal in JavaScript 1.6 and up. Please remove this behavior as it breaks the ability to use JavaScript 1.6-1.8 and also breaks using languages other than JavaScript, like Python (type="application/x-python")
A workaround could be to let the user add any needed things such as CDATA wrappers for XHTML themself. Python doesn't support // comments, so /*<[!CDATA[*/.../*]]>*/ won't work and there are languages that don't support comments either.
If you want to support very, very old browsers, you should have to manually break the syntax and put it in an HTML comment. I don't want TinyMCE doing anything to <script> tags.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Unfortunately the
<!-- ... // -->seems to be needed by the w3.org validator in order for it to work, don't think it's needed by any browsers currently in use. However removing it may bring a lot of "TinyMCE is making my pages invalid!" complains.In any case this should be on the TinyMCE's bug tracker, passing it upstream.