Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-03-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

Actions #1

Updated by Stanislas Rolland over 14 years ago

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.

Actions #2

Updated by Christian Hennecke over 14 years ago

Of course, this also happens with single space characters.

Actions #3

Updated by Stanislas Rolland over 14 years ago

I am unable to reproduce this issue.

Actions #4

Updated by Christian Hennecke over 14 years ago

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.

Actions #5

Updated by Stanislas Rolland over 14 years ago

Any re-occurrence of this issue? Can we close it?

Actions #6

Updated by Christian Hennecke over 14 years ago

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.

Actions #7

Updated by Sebastian Michaelsen over 14 years ago

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.

Actions #8

Updated by Klaus Hinum over 14 years ago

Same here, I often see them when I examine the HTML code that was produced.

Actions #9

Updated by Stanislas Rolland over 14 years ago

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.

Actions #10

Updated by Søren Labansen over 14 years ago

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.

Actions #11

Updated by Stanislas Rolland over 14 years ago

@Sören: Did you clear the RTE cache after applying the patch?

Actions #12

Updated by Søren Labansen over 14 years ago

Yes - also tried to log out and in again.

Actions #13

Updated by Stanislas Rolland over 14 years ago

Could you describe a test case of the problem as you see it?

Actions #14

Updated by Søren Labansen over 14 years ago

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.

Actions #15

Updated by Stanislas Rolland over 14 years ago

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.

Actions #16

Updated by Søren Labansen over 14 years ago

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.
:-)

Actions #17

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF