Ticket #1664 (closed Bug: fixed)

Opened 12 months ago

Last modified 12 months ago

Elements swaping on Enter at the end of paragraphs

Reported by: fredck Owned by: fredck
Priority: Normal Milestone: FCKeditor 2.6
Component: UI : Enter Key Version:
Keywords: Review+ Confirmed Cc:

Description

Steps to Reproduce

  1. Load the following HTML:
<p><font size="6"><font size="1">Hit enter at the end of this line</font></font></p>
  1. Hit ENTER at the end of the line and type some text.
  2. Repeat step 2 may times, and have some fun :)

Current Results

The <font> tags changed order. After enter and "some text", this is what we have:

<p><font size="6"><font size="1">Hit enter at the end of this line</font></font></p>
<p><font size="1"><font size="6">Some text</font></font></p>

Expected Results

The new paragraph must have the formatting tags in the same order:

<p><font size="6"><font size="1">Hit enter at the end of this line</font></font></p>
<p><font size="6"><font size="1">Some text</font></font></p>

Attachments

1664.patch (2.1 KB) - added by fredck 12 months ago.

Change History

Changed 12 months ago by fredck

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

Changed 12 months ago by fredck

Changed 12 months ago by fredck

  • keywords Review? added

The proposed patch inverts the order the elements are created when hitting ENTER at the end of the paragraph.

Changed 12 months ago by martinkou

The pre-patch line in fckenterkey.js...

eFocusElement = eFocusElement.appendChild( FCKDomTools.CloneElement( element ) ) ; 

was doing the tree reconstruction in reverse, since the element path array goes from near to far, and the patch fixes that line. The new tree reconstruction logic in the patch seems correct both in theory and in my tests. So I'm giving it a Review+.

Changed 12 months ago by fredck

  • keywords Review+ added; Review? removed
  • status changed from assigned to closed
  • resolution set to fixed

Based on your comment Martin, I think you forgot to flag it with Review+.

Fixed with [1219]. Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.