Opened 9 years ago

Closed 9 years ago

#2318 closed Bug (invalid)

Text reversed by SPAN and P tags

Reported by: Rob Ripberger Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6.3
Component: General Version: FCKeditor 2.6.2
Keywords: Cc:

Description

When you invoke the FckEditor 2.6.2 with the HTML text below, the resulting HTML text is reversed when editing is complete. It seems has something to do with the P and SPAN tags. In the example below, "First", "Second", and "Third" are in the correct order but when the HTML POST is done the resulting text is "Second", "Third" then "First".

<html> <BODY> <p><span style="font-family: Comic Sans MS"><span style="font-size: small"> <p><span style="font-family: 'Arial','sans-serif'; mso-bidi-font-size: 10.0pt">First</p> </span></span> <p>Second <span style="font-family: Comic Sans MS"><span style="font-size: small"> Third</span></span> </p> </BODY>

Change History (4)

comment:1 Changed 9 years ago by Rob Ripberger

This problem only appears to happen with Internet Explorer, not in Firefox.

comment:2 Changed 9 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

comment:3 Changed 9 years ago by Martin Kou

Keywords: Confirmed IE added

comment:4 Changed 9 years ago by Martin Kou

Keywords: Confirmed IE removed
Resolution: invalid
Status: assignedclosed

Hmm... I'm afraid this isn't really FCKeditor's fault, as the HTML code in the ticket is seriously broken:

  1. The <span style="font-family: 'Arial','sans-serif'; mso-bidi-font-size: 10.0pt"> tag has no closing tag.
  2. The first <p> tag right after <body> has no closing tag either.
  3. According to the HTML4 DTD, you cannot place a <p> tag under a <span> tag. More permissive browsers like Firefox and Safari allow you to do this but doing the same thing in IE would result in a broken DOM tree.
  4. According to the same DTD... a <p> inside another <p> is also wrong (you may want to use an outer <div> instead). Most browsers can still render that ok, but the HTML code is still wrong.

Fixing the HTML code by adding back the end tags and removing the <p> tag around "First" fixes the problem.

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