Ticket #1509 (closed Bug: fixed)

Opened 6 months ago

Last modified 3 months ago

normal whitespace changed into   by innerHtml()

Reported by: kwillems Assigned to: martinkou
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

TC_1509.html (2.0 kB) - added by fredck on 01/30/08 14:02:04.
TC
1509.patch (1.2 kB) - added by martinkou on 02/20/08 10:01:36.

Change History

11/24/07 19:10:31 changed by fredck

  • milestone set to FCKeditor 2.6.

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

01/30/08 14:02:04 changed by fredck

  • attachment TC_1509.html added.

TC

01/30/08 14:04:23 changed by fredck

  • keywords set to Confirmed IE Safari Opera.

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

I've attached a simple TC for it.

02/20/08 09:30:24 changed by martinkou

  • owner set to martinkou.
  • status changed from new to assigned.

02/20/08 10:01:36 changed by martinkou

  • attachment 1509.patch added.

02/21/08 04:31:15 changed by martinkou

  • keywords changed from Confirmed IE Safari Opera to Confirmed IE Review?.

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.

02/22/08 09:03:41 changed by fredck

  • keywords changed from Confirmed IE Review? to Confirmed IE Review+.

02/22/08 09:22:41 changed by martinkou

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed with [1587].

Click here for more info about our SVN system.