Opened 12 years ago

Closed 12 years ago

#248 closed Bug (fixed)

Terminator backspace

Reported by: Guillaume Outters Owned by:
Priority: Normal Milestone: FCKeditor 2.4.1
Component: UI : Enter Key Version: SVN (FCKeditor) - Retired
Keywords: Confirmed Cc:

Description (last modified by Frederico Caldeira Knabben)

Summary: Backspace conglomerates blocks, without being smart.

Example: http://www.fckeditor.net/demo Source <div><br/><h1>Machin</h1></div> Source click before the « M » backspace

Effect: « Machin » disappears

Cause: fckenterkey.js, line 202 (revision 203): when hitting backspace, except in some rare cases, the current element is merged within the previous one. In the example "crasher", <div><br/><h1>Machin</h1></div> became <div><br>Machin</br></div> oops!

Same with an image, and so on.

Priority: if not for the line asking not to play on Priority on bug reports, I would have set this to High.

Change History (3)

comment:1 Changed 12 years ago by Guillaume Outters

Quick patch:

 || !previous.innerHTML || !previous.innerHTML.Trim().length

(as in:

if ( previous.nodeName.IEquals( 'TABLE', 'HR' ) || !previous.innerHTML || !previous.innerHTML.Trim().length )

)

The Trim() would even better be replaced by a TotalTrim which would add &nbsp; to the list of blank characters, because user will be puzzled that his second paragraph gets the style of a preceding invisible char (yes, I have some <div>&nbsp;<br/><p>Machin</p></div>…).

comment:2 Changed 12 years ago by Frederico Caldeira Knabben

Component: GeneralUI : Enter Key
Description: modified (diff)
Keywords: Confirmed added
Milestone: FCKeditor 2.4.1
Version: SVN

Confirmed with FF2 and IE6, which also throws an error on that case.

comment:3 Changed 12 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

Fixed with [218].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy