Ticket #8870 (closed Bug: fixed)
Content from table within <pre> tag is removed.
| Reported by: | pauljvrw | Owned by: | garry.yao |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 3.6.3 |
| Component: | Core : Tables | Version: | 3.6.3 |
| Keywords: | Cc: |
Description
Put the following
Example code with text in the table cells to be pasted in code view:
<pre> <table border="1" cellpadding="1" cellspacing="1" style="width: 500px;" summary="bla2"> <caption> bla</caption> <tbody> <tr> <td> 1</td> <td> a</td> </tr> <tr> <td> 2</td> <td> b</td> </tr> <tr> <td> 3</td> <td> c</td> </tr> </tbody> </table> </pre>
Code after switch to wysiwyg mode:
<pre> </pre> <table border="1" cellpadding="1" cellspacing="1" style="width: 500px;" summary="bla2"> <caption> bla</caption> <tbody> </tbody> <tbody> </tbody> <tbody> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table>
Now the a b c and 1 2 3 are gone. Expected: that the pre still surrounds the table and that the table content is not removed.
Second example is with style on a cell of the table (some background color) to be pasted in code view:
<pre> <table border="1" cellpadding="1" cellspacing="1" style="width: 500px;" summary="bla2"> <caption> bla</caption> <tbody> <tr> <td style="background-color: rgb(51, 102, 102);"> </td> </tr> </tbody> </table> </pre>
Code after switch to wysiwyg mode:
<pre> </pre> <table border="1" cellpadding="1" cellspacing="1" style="width: 500px;" summary="bla2"> <caption> bla</caption> <tbody> </tbody> <tbody> <tr> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table>
The style on the cell is gone. And the amount of cells within the table is changed.
Expected: no change to the html and styles.
Both examples are probably the same regression compared to version 3.6.2 where these problems do not occur.
In case someone thinks this is not invalid html an example of a table within a pre tag: any revision diff page on code.google.com.
Attachments
Change History
comment:2 Changed 14 months ago by j.swiderski
- Status changed from new to confirmed
Reproducible from CKEditor 3.6.3 rev. [7411]
comment:3 Changed 14 months ago by garry.yao
- Status changed from confirmed to review
- Owner set to garry.yao
comment:4 follow-up: ↓ 6 Changed 14 months ago by garry.yao
Expected: that the pre still surrounds the table and that the table content is not removed.
This is not part of the patch though, CKEditor works with XHTML1.0 dtd and this's not valid XHTML. I understand this's not a problem for HTML5 while it's out the scope of this ticket.
comment:6 in reply to: ↑ 4 Changed 14 months ago by fredck
Replying to garry.yao:
Expected: that the pre still surrounds the table and that the table content is not removed.
This is not part of the patch though, CKEditor works with XHTML1.0 dtd and this's not valid XHTML. I understand this's not a problem for HTML5 while it's out the scope of this ticket.
Lemme make a small correction on this. Not even HTML5 says that <table> can be inside <pre>. Only phrasing elements are accepted.
comment:7 in reply to: ↑ description Changed 14 months ago by fredck
Replying to pauljvrw:
In case someone thinks this is not invalid html an example of a table within a pre tag: any revision diff page on code.google.com.
Well, this just says that Google uses invalid HTML, not that it is valid. Unfortunately this is not a good justification for that.
The thing is that we need to come to a compromise and our difference is that we're not just HTML consumers but HTML producers as well, and people expect us to produce good HTML.

"In case someone thinks this is not invalid html an example of a table within a pre tag: any revision diff page on code.google.com. "
should be
"In case someone thinks this is not valid html an example of a table within a pre tag: any revision diff page on code.google.com. "