Bug #16217
closedLeading and trailing blanks can't be edited
100%
Description
I will explain this issue by an example:
Following input ([blank] stands for a blank)
[blank]test[blank]
to an RTE field inserted and saved with "RTE disabled" or pasted into an htmlarea powered RTE field will render to the following HTML code inside the textarea tags delivered by htmlarea:
<p>[blank]test[blank]</p>
The two blanks are still there but can't be properly edited when the RTE is enabled (why?):
In IE, they are partially removed after saving (generally spoken, leading blanks seem to be removed somewhere, trailing blanks seem to be editable).
In Firefox, all leading and trailing blanks are still there after saving and never editable.
Under certain circumstances (eg if sorting in the backend is triggered by a RTE field and editors are supposed to always use the RTE and copy and paste from the outside world) this can be pretty bothering.
Suggestion for resolving the issue:
One possible fix would be to assure a consistent behaviour and trim all leading and trailing white-space from rte->db. That approach might not be acceptable for all circumstances although at this time, I can't imagine why one would like to have leading or trailing white-space in an RTE field which afterwards isn't properly editable anyways.
The suggested behaviour could be simply achieved by patching the core... hm... I'm fine with that and it's just a suggestion.
t3lib_parsehtml_proc::TS_transform_db in class.t3lib_parsehtml_proc.php
}
$this->TS_transform_db_safecounter++;return implode('',$blockSplit);
}
---
< }
< $this->TS_transform_db_safecounter++;
<
< return trim(implode('',$blockSplit));
< }
(issue imported from #M3632)
Files
Updated by Ralf Hettinger over 18 years ago
just correcting a typo in the description
"
[...] will render to the following HTML code inside the textarea tags delivered by htmlarea:
<p>[blank]test[blank]</p>
[...]
"
Updated by Stanislas Rolland about 16 years ago
I cannot reproduce this behaviour with latest trunk in Firefox3 nor in IE7. Do you still encounter this issue?
Updated by Xavier Perseguers about 16 years ago
I can reproduce this bug:
- Create a new textblock
- switch to source code
- type [blank]test[blank]
- switch back to RTE
- save
- leading space is not editable, trailing space can be edited/deleted
- Rendered to FE as <p>[blank]test[blank]</p> (with or without additional stuff in p according to the RTE config
I did it with FF3 and 4.2.1 + trunk
Updated by Stanislas Rolland about 16 years ago
Thanks. Now I understand how to reproduce.
Updated by Stanislas Rolland about 16 years ago
The problem also exists if you add leading and trailing spaces inside a paragraph in text mode. In FF, the leading space remains there but is not editable. IE removes it. In IE, the trailing space is editable, not in FF.
I note that IE collapses any repeating such spaces into a single one. In FF, if you insert a sequence of repeating spaces in the middle of a word in text mode, they are shown as one in wysiwyg mode, but they are still there.
Safari, Chrome and Opera all behave like Firefox.
Updated by Stanislas Rolland about 16 years ago
The attached patches (one for trunk, the other for TYPO3 4.2 branch) will:
1. collapse repeating spaces into a single one;
2. replace leading and trailing spaces with non-breaking spaces.
3. replace any space following > and any space preceding < by a non-breaking space.
Please comment and test.
Updated by Andreas Wolf over 13 years ago
- Assignee set to Stanislas Rolland
- Target version deleted (
0) - TYPO3 Version set to 4.0
Hey Stan, is this still relevant?
Updated by Stanislas Rolland over 13 years ago
Andreas Wolf wrote:
Hey Stan, is this still relevant?
Just forgot about that one. Will need to submit patches to gerrit for current releases.
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change I06a8996f23e050e2e30cc2548c9c1bbafd5b41f0 has been pushed to the review server.
It is available at http://review.typo3.org/4758
Updated by Stanislas Rolland over 13 years ago
- Status changed from Needs Feedback to Under Review
Updated by Mr. Hudson about 13 years ago
Patch set 1 of change I630249ddf143c401706688a10867ddd33493f971 has been pushed to the review server.
It is available at http://review.typo3.org/6258
Updated by Stanislas Rolland about 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 5e37e10267bb71984035fec1fc0c43b1c0f167f2.
Updated by Stanislas Rolland almost 13 years ago
- Status changed from Resolved to New
- TYPO3 Version changed from 4.0 to 4.5
The last two lines of the merged patch are wrong.
They should replace only leading and trailing spaces inside block elements.
Updated by Alexander Opitz almost 10 years ago
- Status changed from New to Needs Feedback
- Is Regression set to No
@Stanislas
You reopened this issue. Is the missing part already fixed, so this issue can be closed again?
Updated by Wouter Wolters over 9 years ago
- Status changed from Needs Feedback to Closed
The mentioned lines are removed in master and 6.2. Will close the issue now.