Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#1509 closed Bug (fixed)

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 (2)

TC_1509.html (2.0 KB) - added by fredck 8 years ago.
TC
1509.patch (1.2 KB) - added by martinkou 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 9 years ago by fredck

  • Milestone set to FCKeditor 2.6

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

Changed 8 years ago by fredck

TC

comment:2 Changed 8 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.

comment:3 Changed 8 years ago by martinkou

  • Owner set to martinkou
  • Status changed from new to assigned

Changed 8 years ago by martinkou

comment:4 Changed 8 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.

comment:5 Changed 8 years ago by fredck

  • Keywords Review+ added; Review? removed

comment:6 Changed 8 years ago by martinkou

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed with [1587].

Click here for more info about our SVN system.

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