Question

I'm getting unnecessary space in my source code when executing the main page. No clue from where this space is coming from. It was coded using TYPO3 Flow (formerly Flow3) concepts. I need to call one XML file - but because of the blank spaces it doesn't satisfy the xml rules

It showing 27 blank lines, and in the 27th line it starts to display the markup, just like this layout:

 ...
 ...
 24
 25
 26
 27 <!DOCTYPE html>
 28   <head>
 29      <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 30      <title>REST Test</title>
 ...
 ...
Was it helpful?

Solution

Use a plugin (like TS Tidy) or similar.

Any similar plugin will format your HTML when its rendered by the server and before it is sent to the browser. Remove blank lines, indent tags, etc. Most of these plugins, in any engine or language, are based on the venerable HTMLTidy/XMLTidy.

OTHER TIPS

This problem is caused by Fluid, the template engine, you just need to take care of your namespace declaration in your Layouts, replace this:

<!DOCTYPE html>
{namespace foo=My\Package\ViewHelpers}
{namespace world=My\Package\ViewHelpers}
<html>

by this

<!DOCTYPE html>{namespace foo=My\Package\ViewHelpers}{namespace world=My\Package\ViewHelpers}
<html>

And no more unneeded line break

In flow3 if there is any error/warring in any of the packages that which we created it will reflect to the active one.This cause blank line in my case.when i remove that package it solve the issue(blank lines)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top