Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9436 closed Bug (invalid)

Span in IE8 not works correctly

Reported by: Yinfeng.Guo Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.5
Keywords: Span IE8 Cc: haobo.song@…, yinfeng.guo@…

Description

Dear Sir or Madam,

Sorry for disturbing you.

We found a bug, the whole source code is as below:

<html>
<head>
	<script type="text/javascript" src="../ckeditor.js"></script>
</head>
<body>
	<textarea  id="a" ></textarea>
	<script type="text/javascript">
             var b = CKEDITOR.replace("a");
             b.setData('<span class="c"/><div>d<div>')
	</script>	
</body>
</html>

The problem is:
In IE8, the code will change from

<span class="c"/><div>d<div>

to

<div>
	<span class="c">d</span>
	<div>
		&nbsp;</div>
</div>

In conclusion: we don't want the char 'd' in the <span> tag.

We appreciate it if you could solve this. Many thanks in advance. :)
Have a good day!

Best Regards,
Yinfeng

Change History (3)

comment:1 Changed 7 years ago by Yinfeng.Guo

I find the above source code happens that problem in Chrome and IE9 too.

But the below code only happens in IE8:

<html>
<head>
	<script type="text/javascript" src="../ckeditor.js"></script>
</head>
<body>
	<textarea  id="a" ></textarea>
	<script type="text/javascript">
             var b = CKEDITOR.replace("a");
             b.setData('<div class="c"><span class="d"/></div><table> <tbody> <tr> <td> e</td> </tr> </tbody> </table>')
	</script>	
</body>
</html>

In IE8, code will change to:

<div class="c">
	&nbsp;</div>
<table>
	<tbody>
		<tr>
			<td>
				<span class="d">e</span></td>
		</tr>
	</tbody>
</table>

The span tag goes into the table tag.

Best Regards,
Yinfeng

comment:2 Changed 7 years ago by Piotrek Koszuliński

Resolution: invalid
Status: newclosed
  1. span isn't self closing tag and can't be used with />. In your code span starts, but never ends, so parsers wraps entire content in it and then fixes this code, because span wraps block elements. Fix this and issue 2. doesn't exist.
  2. The same with the first issue - beside span issue, there are also two opened divs, but none is closed, so parser closes them for you. Results are fine.

comment:3 in reply to:  2 Changed 7 years ago by Yinfeng.Guo

Replying to Reinmar:

  1. span isn't self closing tag and can't be used with />. In your code span starts, but never ends, so parsers wraps entire content in it and then fixes this code, because span wraps block elements. Fix this and issue 2. doesn't exist.
  2. The same with the first issue - beside span issue, there are also two opened divs, but none is closed, so parser closes them for you. Results are fine.


Reinmar, Thanks a lot for your quick response, very helpful. Have a good day! :)

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