Bug #86862

Using <f:spaceless> in layout for rendering any fluid_styled_content element causes valid RTE content to be be destroyed.

Added by Helmut Hummel about 1 year ago. Updated 5 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Fluid Styled Content
Target version:
-
Start date:
2018-11-06
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

As pointed out here: #80695 <f:spaceless> removes too much whitespace in certain contexts.

Important here is, that RTE content potentially is such context.

Therefore I suggest to remove the <f:spaceless> from the layout


Related issues

Related to TYPO3 Core - Bug #88203: RTE CKEditor removes spaces between formatted words Closed 2019-04-25
Duplicated by TYPO3 Core - Bug #85777: <f:spaceless> eats too many blank spaces Closed 2018-08-08
Duplicated by TYPO3 Core - Bug #80695: f:spaceless ViewHelper removes too many spaces Closed 2017-04-05

Associated revisions

Revision b72e2a51 (diff)
Added by Georg Ringer 5 months ago

[!!!][BUGFIX] Remove f:spaceless from default layout

As the ViewHelper `f:spaceless` removes too many spaces it should not be
used in the default layouts.

Resolves: #86862
Releases: master
Change-Id: Ie7f66554f240da9823899f357811903fa8285956
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/58858
Tested-by: TYPO3com <>
Tested-by: Benjamin Kott <>
Tested-by: Torben Hansen <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Benjamin Kott <>
Reviewed-by: Torben Hansen <>
Reviewed-by: Anja Leichsenring <>

History

#1 Updated by Helmut Hummel about 1 year ago

  • Related to Bug #80695: f:spaceless ViewHelper removes too many spaces added

#2 Updated by Helmut Hummel about 1 year ago

Example:

<strong>my bold text</strong> <em>with a space to the emphasize</em>

note, that it is totally valid in RTE context to have two different inline formattings separated with a space

#3 Updated by Markus Klein about 1 year ago

I agree with that!

There is no other sane solution to solve this.

#4 Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58858

#5 Updated by Riccardo De Contardi about 1 year ago

also related? #85777

#6 Updated by Markus Klein about 1 year ago

  • Related to Bug #85777: <f:spaceless> eats too many blank spaces added

#7 Updated by Markus Klein about 1 year ago

  • Related to deleted (Bug #85777: <f:spaceless> eats too many blank spaces)

#8 Updated by Markus Klein about 1 year ago

  • Duplicated by Bug #85777: <f:spaceless> eats too many blank spaces added

#9 Updated by Markus Klein about 1 year ago

  • Related to deleted (Bug #80695: f:spaceless ViewHelper removes too many spaces)

#10 Updated by Markus Klein about 1 year ago

  • Duplicated by Bug #80695: f:spaceless ViewHelper removes too many spaces added

#11 Updated by Benjamin Kott about 1 year ago

Removing the spaceless viewhelper is a massive change in behaviour during released versions that WILL lead to visual differences. Please see very very simple example: https://codepen.io/benjaminkott/pen/dQYwwy

This will make the change breaking, and so the change must atleast be marked as beeing that. If you rely on these to reduce for example spacing between buttons or other examples. You will need to adapt your templates and override the layout if you are currently not doing this.

In addition we reintroduce a lot of unnessesary bloat we tried to remove in the first place. That means if you are fine with the current solution you will now need to take additional actions to optimize the html output.

Means, whatever we will change, it will be breaking in some kind or another. This is why i prefer not to make any backports to older versions in this area.

But since v9.5 is almost fresh out of the door we can/should make an exception for this one. But i would still like to see an option that keeps the compression and the removal of bloat, but is handling block and inline elements differently/better.

#12 Updated by Helmut Hummel about 1 year ago

Benjamin Kott wrote:

Please see very very simple example: https://codepen.io/benjaminkott/pen/dQYwwy

Well, yes. inline-block elements must not have spaces to avoid gaps when gaps are not wanted. In RTE context (or any context where basically editors control the HTML), inline-block elements must have spaces

I tend to say that situations where spaces need to be removed between inline-block elements are not controlled by editors, right?
I at least can't imagine a case where editors add a space and this space should be trimmed.

So when you don't want a CSS fix for this issue, you have to adapt your templates to not have gaps where you don't want one. But CSS fixes might be a tradeoff:
https://stackoverflow.com/questions/5078239/how-do-i-remove-the-space-between-inline-block-elements

But i would still like to see an option that keeps the compression and the removal of bloat, but is handling block and inline elements differently/better.

If I'm not completely mistaken, it is impossible to decide on HTML level where to trim and where not (HTML parsing is hard enough), but since CSS defines which tag should be displayed as inline block,
we can't do anything on HTML level.

#13 Updated by Markus Klein about 1 year ago

Lets fix the 90% case. I would argue the space stuff within RTE is affecting more people than the button stuff. But maybe I'm wrong about that. Thinking of our customers I see mostly see the argument "I want to control the output of my text myself".

#14 Updated by Gerrit Code Review 11 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58858

#15 Updated by Riccardo De Contardi 7 months ago

  • Related to Bug #88203: RTE CKEditor removes spaces between formatted words added

#16 Updated by Andreas Kiessling 6 months ago

Any news on that issue? We just had to override the layout to get the whitespace back..

#17 Updated by Gerrit Code Review 5 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58858

#18 Updated by Georg Ringer 5 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF