#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"> </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)
Change History (8)
comment:1 Changed 17 years ago by
Milestone: | → FCKeditor 2.6 |
---|
comment:2 Changed 17 years ago by
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 17 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
Changed 17 years ago by
Attachment: | 1509.patch added |
---|
comment:4 Changed 17 years ago by
Keywords: | Review? added; Safari Opera removed |
---|
The 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 added in IE by FCKeditor.
Interesting, the 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 " " or the 0xA0 character there, which is what Opera and Safari did.
Since the 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 17 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:6 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [1587].
Click here for more info about our SVN system.
Still to check it, but targeting to the 2.6 for now.