Ticket #8870 (closed Bug: fixed)

Opened 2 years ago

Last modified 2 years ago

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

8870.patch (1.3 KB) - added by garry.yao 2 years ago.

Change History

comment:1 Changed 2 years ago by 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. "

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

comment:2 Changed 2 years ago by j.swiderski

  • Status changed from new to confirmed

Reproducible from CKEditor 3.6.3 rev. [7411]

Changed 2 years ago by garry.yao

comment:3 Changed 2 years ago by garry.yao

  • Status changed from confirmed to review
  • Owner set to garry.yao

comment:4 follow-up: ↓ 6 Changed 2 years 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.

Last edited 2 years ago by garry.yao (previous) (diff)

comment:5 Changed 2 years ago by garry.yao

  • Milestone set to CKEditor 3.6.3

comment:6 in reply to: ↑ 4 Changed 2 years 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 2 years 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.

comment:8 Changed 2 years ago by fredck

  • Status changed from review to review_passed

comment:9 Changed 2 years ago by garry.yao

  • Status changed from review_passed to closed
  • Resolution set to fixed

Fixed with [7454].

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy