Bug #22261
closed
RTE randomly inserts non-breaking spaces instead of spaces
Added by Christian Hennecke over 14 years ago.
Updated about 6 years ago.
Description
When entering text in a RTE field, e.g., for a text content element or news, the RTE sometimes inserts a non-breaking space instead of a normal space character.
This happens with several versions of TYPO3 and Firefox, including the latest ones. So far I haven't been able to find the circumstances that trigger this behavior.
I suspect that the speed of the machine the editing is done with and the speed of typing may have something to do with it.
(issue imported from #M13791)
Files
I think that this is not a bug. If you enter a series of consecutive spaces, every second one will be a non-breaking one. Otherwise, the series of spaces will be rendered as just one space in the FE. The RTE assumes that the spaces have been entered intentionally by the author.
Of course, this also happens with single space characters.
I am unable to reproduce this issue.
This does NOT happen if you paste text into the RTE, only if you type it yourself. Actually, the issue seems to have improved a lot with TYPO3 4.3.2 and current Firefox versions. At the moment I'm not able to reproduce it either. I'll keep an eye on this.
Any re-occurrence of this issue? Can we close it?
From what I've seen it has improved but not vanished. Judging from closer investigation I think that it happens when you write something, delete something to correct an error using the backspace or delete keys and start typing again.
Can confirm this issue. I didn't investigate when exactly it occurs but I nagged me some times and editors came to me with the same problem.
Same here, I often see them when I examine the HTML code that was produced.
I believe the problem originates in the bookmarks inserted by the undo/redo snapshots. Bookmark removal leaves some text node that the browsers eventually convert to unwanted space characters.
The attached patches for trunk and branches 4.3 and 4.4 should fix this issue.
I've this issue with both 4.4 and 4.3.
It happens both in IE, Firefox and Chrome (latest versions).
Applying the patches did not fix this problem.
Apparently it only happens when you make a space beside an exisisting space. Not when you make a space inside some other text.
@Sören: Did you clear the RTE cache after applying the patch?
Yes - also tried to log out and in again.
Could you describe a test case of the problem as you see it?
Rather simple:
In other charachters/words - no problem. Space is inserted correct. E.g. inside "testtext" like so "test text"
Beside an exsisting space " " like so " " - it inserts or maybe convert the exsisting space to non-breaking space.
This happens in IE, FF and Chrome (latest versions) with 4.3 and 4.4. I use the default Typo3 Source Package installed as recommended.
I think this is the intended behaviour. Browsers will always truncate spaces in HTML pages. If you write 10 spaces in your text, the browser will remove 9 of them, before displaying the page.
Therefore, if consecutive spaces are entered in the RTE, all but the last one are converted to non-breaking spaces. This is the default editing behaviour in all browsers, without any special handling by the RTE scripts.
The present issue was about the behaviour in FF. Consecutive spaces became alternating non-breaking and normal spaces. This was creating problems when editing the content later. This is fixed by the attached patch, so that the resulting content in FF is exactly the same as in other browsers.
Ok.
Thank you for making it clear.
That behavior just seems to create problems for some of my users - but I guess they'll have to live with it.
:-)
- Status changed from Resolved to Closed
Also available in: Atom
PDF