Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#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.

Change History (7)

#1 @azaozz
17 years ago

  • Priority highnormal
  • Severity majornormal

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.

#2 @hakre
17 years ago

not a bad idea imho: "I don't want TinyMCE doing anything to <script> tags."

#3 @Denis-de-Bernardy
17 years ago

suggesting wontfix, after opening a ticket with moxiecode

#4 @Denis-de-Bernardy
17 years ago

  • Keywords dev-feedback added

#5 @Denis-de-Bernardy
17 years ago

  • Milestone 2.7.2
  • Resolutioninvalid
  • Status newclosed

passed upstream

#6 follow-up: @hakre
17 years ago

any reference to moxiecode ticket?

#7 in reply to: ↑ 6 @Denis-de-Bernardy
17 years ago

Replying to hakre:

any reference to moxiecode ticket?

I'm assuming andrew has one, or sent them an email. See his first reply.

Plus, frankly, nobody should be using tinymce on a post that contains scripts. :D

Note: See TracTickets for help on using tickets.