Opened 16 years ago

Closed 16 years ago

Last modified 14 years ago

#1509 closed Bug (fixed)

normal whitespace changed into   by innerHtml()

Reported by: Koen Willems Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6
Component: General Version: FCKeditor 2.5 Beta
Keywords: Confirmed IE Review+ Cc:

Description

I noticed that insertHtml() in IE 6 and IE 7 changes a preceding whitespace (like ' ') into ' '.
As far as I can see this behaviour is caused by the following line (number 165) in fck_ie.js:

html = '<span id="fakeFCKRemove">&nbsp;</span>' + html ; BR]]

Changing this line into (for example)

html = '<span id="fakeFCKRemove">fakeFCKRemove</span>' + html ;

seems to solve this.

Regards, Koen Willems

Attachments (2)

TC_1509.html (2.0 KB) - added by Frederico Caldeira Knabben 16 years ago.
TC
1509.patch (1.2 KB) - added by Martin Kou 16 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 16 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.6

Still to check it, but targeting to the 2.6 for now.

Changed 16 years ago by Frederico Caldeira Knabben

Attachment: TC_1509.html added

TC

comment:2 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Confirmed IE Safari Opera added

Confirmed with IE7, Safari and Opera. Ok with FF only.

I've attached a simple TC for it.

comment:3 Changed 16 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

Changed 16 years ago by Martin Kou

Attachment: 1509.patch added

comment:4 Changed 16 years ago by Martin Kou

Keywords: Review? added; Safari Opera removed

The &nbsp; in Opera and Safari are added by the browser itself when a space is typed at the end of paragraph, so it is different from the &nbsp; added in IE by FCKeditor.

Interesting, the &nbsp; added by Opera and Safari is arguably more correct then what we're seeing in IE and Firefox - they're trying to preserve the single space you entered towards the end of the paragraph in the HTML code. They're doing this because having any ANSI whitespaces towards the end of a <P> block are ignored. Say, you wrote an HTML file with the following paragraph:

<P>Some text here </P>

The space after "here" is not rendered, and the only way to get a single space rendered after "here" is to add an "&nbsp;" or the 0xA0 character there, which is what Opera and Safari did.

Since the &nbsp; in Safari and Opera is added by the browser rather than by FCKeditor, and they have a good reason for doing so. I suggest we only fix the issue for IE, and just leave it as-is in Opera and Safari.

Also, in addition to the suggested change, I've added a "display: none" style attribute in my patch to prevent the string from flashing visibly in slow computers, as it had happened in the past with the selection logic and IE.

comment:5 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:6 Changed 16 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [1587].

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