#5220 closed Bug (fixed)
Style tag in body element messes output in CKEditor fullpage edit
Reported by: | Matti Järvinen | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.3 |
Component: | Core : Output Data | Version: | SVN (CKEditor) - OLD |
Keywords: | Confirmed Review+ | Cc: | ckeditor@… |
Description
Paste in fullpage edit source mode
<html> <head> <title>CKEditor Sample</title> </head> <body> <style type="text/css"> p { border: 1px solid green; }</style> <p> This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p> </body> </html>
Switch to wysiwyg and back to source results...
<html> <head> <title>CKEditor Sample</title> </head> <body> </body> </html> <style type="text/css"> p { border: 1px solid green; }</style> <body> <p> This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p> </body>
Tested on svn: 5171
Attachments (1)
Change History (11)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Milestone: | CKEditor 3.x → CKEditor 3.3 |
---|---|
Priority: | Normal → High |
comment:3 Changed 15 years ago by
Also some of our users have experienced this causing their browser to crash. It appears that there may be a long/infinite loop that is crashing the browser.
comment:4 Changed 15 years ago by
Component: | General → Core : Output Data |
---|---|
Keywords: | Confirmed added |
Owner: | set to Garry Yao |
Priority: | High → Normal |
Status: | new → assigned |
Changed 15 years ago by
Attachment: | 5220.patch added |
---|
comment:5 Changed 15 years ago by
Keywords: | Review? added |
---|
Though neither valid HTML nor XHTML allow <style> inside blocks, while it's a habit of web developers that we could show some tolerance here.
comment:6 follow-up: 8 Changed 15 years ago by
That fix seems to work in my case, but there is one more associated issue. It used to be common practice to put HTML comments inside style tags to prevent the style from causing issues in browsers that did not support css. Many of our users still do this. For example:
<style type="text/css"> <!-- p{color:red} --> </style>
Becomes in the final output
<style type="text/css"> <!--{cke_protected}{C}%3C!%2D%2D%0Ap%7Bcolor%3Ared%7D%0A%2D%2D%3E--> </style>
The HTML comment in the stlye tag gets protected, but not un-protected.
comment:7 Changed 15 years ago by
Cc: | ckeditor@… added |
---|
comment:8 Changed 15 years ago by
comment:9 Changed 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
This is doing even stranger things if the style tag appear within a nested table. The content gets duplicated, and on the fullpage demo, the source can not be edited again, and submitting does not work.
Tested on svn: 5242
becomes