Bug #81616

TYPO3 generated HTML-output strips off whitespaces/linebreaks between tags.

Added by Tobias Riesemann 9 days ago. Updated 7 days ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-06-19
Due date:
% Done:

100%

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

Description

TYPO3 generated HTML-output strips off whitespaces/linebreaks between tags.

If source consists of two tags e.g. SPANs which are divided by a newline or whitespace, they were rendered without any whitespace between.

<span>foo</span>
<span>bar</span>

will result in:

foobar

I have this Problem in all generated content such as in RTE.
All output is generated using Fluid-Styled-Content.

IMHO it's a problem if whitespaces are trimmed off of inline tags.
Could you please check this elementary problem?

Thx in advance
Tobias


Related issues

Related to Core - Bug #81577: f:format.html / parseFunc removes spaces between tags Closed 2017-06-14

History

#1 Updated by Mona Muzaffar 9 days ago

  • Related to Bug #81577: f:format.html / parseFunc removes spaces between tags added

#2 Updated by Mona Muzaffar 9 days ago

  • Category set to Fluid Styled Content
  • Status changed from New to Needs Feedback

Another user had the same issue
and found out the reason for the missing whitespaces is the spaceless viewhelper in fluid_styled_content
(see https://forge.typo3.org/issues/81577#note-4).

Could this be your issue as well? You could try removing the viewhelper in order to test it.

#3 Updated by Tobias Riesemann 8 days ago

Mona Muzaffar wrote:

Another user had the same issue
and found out the reason for the missing whitespaces is the spaceless viewhelper in fluid_styled_content
(see https://forge.typo3.org/issues/81577#note-4).

Could this be your issue as well? You could try removing the viewhelper in order to test it.

Thanks for your fast reply.

I double-checked any Spaceless-VH that I use and removed it for some tests => no success.

Then I tried it in a new installation without using Fluid-Styled-Content - just plain TS with: Content rendered as "styles.content.get". ... same result. The tags are rendered without whitespace.

page = PAGE
page {

    5 = TEXT
    5.value = This is a <span>new</span> <i>test</i> with TYPO3 CMS 8.7

    10 < styles.content.get
    10.select.where = colPos = 0
}

As example for page.10 in the backend I used a simple HTML-Element with this content:

<span style="color:red">Test</span> <span style="color:green">Huiii</span>
  • page.5 is good as expected
  • page.10 is rendered without spaces

#4 Updated by Tobias Riesemann 8 days ago

  • Category deleted (Fluid Styled Content)

#5 Updated by Riccardo De Contardi 7 days ago

  • Category set to Fluid Styled Content

@Tobias Riesemann if you are using EXT:fluid_styled_content, the content elements are still rendered using a FLUIDTEMPLATE object, no matter if you use or not a FLUIDTEMPLATE object for your page or just plain typoscript as in your example :)

Said that, the <f:spaceless> viewhelper comes from EXT:fluid_styled_content/Resources/Private/Layouts/Default.html; if you remove it, your HTML element will have spaces between tags.

Or did you try to use CSS_Styled_content instead?

#6 Updated by Tobias Riesemann 7 days ago

  • Category deleted (Fluid Styled Content)

Hi Riccardo,

as you wrote I copied the original Default.html to my Layouts directory and removed f:spaceless.
Now all works perfect.

Info:
I am using own layouts (since 8.?) for my project, but some of my templates files are using the Default.html layout. So I was searching for f:spaceless in my own project folders and didn't find anything.

Thanks a lot!

Tobias

#7 Updated by Tobias Riesemann 7 days ago

  • % Done changed from 0 to 100

#8 Updated by Mona Muzaffar 7 days ago

  • Status changed from Needs Feedback to Resolved

Also available in: Atom PDF