Opened 17 years ago

Closed 17 years ago

#1664 closed Bug (fixed)

Elements swaping on Enter at the end of paragraphs

Reported by: Frederico Caldeira Knabben Owned by: Frederico Caldeira Knabben
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 (1)

1664.patch (2.1 KB) - added by Frederico Caldeira Knabben 17 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 17 years ago by Frederico Caldeira Knabben

Owner: set to Frederico Caldeira Knabben
Status: newassigned

Changed 17 years ago by Frederico Caldeira Knabben

Attachment: 1664.patch added

comment:2 Changed 17 years ago by Frederico Caldeira Knabben

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 17 years ago by Martin Kou

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 17 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed
Resolution: fixed
Status: assignedclosed

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 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy