Opened 6 years ago

Closed 6 years ago

#8870 closed Bug (fixed)

Content from table within <pre> tag is removed.

Reported by: Paul Veldema 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 (1)

8870.patch (1.3 KB) - added by Garry Yao 6 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by Paul Veldema

"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 6 years ago by Jakub Ś

Status: newconfirmed

Reproducible from CKEditor 3.6.3 rev. [7411]

Changed 6 years ago by Garry Yao

Attachment: 8870.patch added

comment:3 Changed 6 years ago by Garry Yao

Owner: set to Garry Yao
Status: confirmedreview

comment:4 Changed 6 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 6 years ago by Garry Yao (previous) (diff)

comment:5 Changed 6 years ago by Garry Yao

Milestone: CKEditor 3.6.3

comment:6 in reply to:  4 Changed 6 years ago by Frederico Caldeira Knabben

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 6 years ago by Frederico Caldeira Knabben

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 6 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:9 Changed 6 years ago by Garry Yao

Resolution: fixed
Status: review_passedclosed

Fixed with [7454].

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