Ticket #2318 (closed Bug: invalid)

Opened 21 months ago

Last modified 21 months ago

Text reversed by SPAN and P tags

Reported by: rrip Owned by: martinkou
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

Changed 21 months ago by rrip

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

Changed 21 months ago by martinkou

  • owner set to martinkou
  • status changed from new to assigned

Changed 21 months ago by martinkou

  • keywords Confirmed IE added

Changed 21 months ago by martinkou

  • keywords Confirmed IE removed
  • status changed from assigned to closed
  • resolution set to invalid

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.