Ticket #1664 (closed Bug: fixed)

Opened 6 years ago

Last modified 6 years 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 6 years ago.

Change History

comment:1 Changed 6 years ago by fredck

  • Owner set to fredck
  • Status changed from new to assigned

Changed 6 years ago by fredck

comment:2 Changed 6 years 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.

comment:3 Changed 6 years 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+.

comment:4 Changed 6 years 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.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy