Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

adding white spaces in page view source

veerareddyc2547
Level 3
Level 3

Hi Team,

I have code like below screen shot

1567808_pastedImage_0.png

if there is any sly tag in code it is creating white space in page view source like below

1567809_pastedImage_1.png

Are there any ways to remove the white spaces.

Thanks in advance.

1 Accepted Solution
kautuk_sahni
Correct answer by
Employee
Employee
0 Replies
Arun_Patidar
Community Advisor
Community Advisor

Hi,

This extra space won't make any impact on HTML rendering. Removing white spaces won't be making any difference and will be add extra overhead to remove white spaces either using javascript/jquery or sling output rewrite.

I suggest, let it be.

If you want to know more about white spaces in HTML, go through with https://medium.com/@patrickbrosset/when-does-white-space-matter-in-html-b90e8a7cdd33

Jörg_Hoh
Employee
Employee

I don't see any white spaces being added, but rather new lines.

Jörg

kautuk_sahni
Correct answer by
Employee
Employee

This is Sling issue.

Here it is -issue: [SLING-4443] Whitespace removal for Sightly HTML output - ASF JIRA

It is still open.

veerareddyc2547
Level 3
Level 3

Hi All,

Thanks for your response.

Can't we remove the white lines by using ContentBinder ? if yes suggest me how to proceed.