Ticket #1509 (closed Bug: fixed)

Opened 2 years ago

Last modified 2 years ago

normal whitespace changed into   by innerHtml()

Reported by: kwillems Owned by: 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 Download (2.0 KB) - added by fredck 2 years ago.
TC
1509.patch Download (1.2 KB) - added by martinkou 2 years ago.

Change History

Changed 2 years ago by fredck

  • milestone set to FCKeditor 2.6

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

Changed 2 years ago by fredck

TC

Changed 2 years ago by fredck

  • keywords Confirmed IE Safari Opera added

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

I've attached a simple TC for it.

Changed 2 years ago by martinkou

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

Changed 2 years ago by martinkou

Changed 2 years ago by martinkou

  • 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.

Changed 2 years ago by fredck

  • keywords Review+ added; Review? removed

Changed 2 years ago by martinkou

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

Fixed with [1587].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.