Opened 16 years ago
Closed 16 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 16 years ago by
comment:2 Changed 16 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
comment:3 Changed 16 years ago by
Keywords: | Confirmed IE added |
---|
comment:4 Changed 16 years ago by
Keywords: | Confirmed IE removed |
---|---|
Resolution: | → invalid |
Status: | assigned → closed |
Hmm... I'm afraid this isn't really FCKeditor's fault, as the HTML code in the ticket is seriously broken:
- The <span style="font-family: 'Arial','sans-serif'; mso-bidi-font-size: 10.0pt"> tag has no closing tag.
- The first <p> tag right after <body> has no closing tag either.
- 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.
- 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.
This problem only appears to happen with Internet Explorer, not in Firefox.