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
BedrockMission!

Learn More

View all

Sign in to view all badges

adding white spaces in page view source

Avatar

Avatar
Validate 10
Level 2
veerareddyc2547
Level 2

Likes

5 likes

Total Posts

36 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
veerareddyc2547
Level 2

Likes

5 likes

Total Posts

36 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
veerareddyc2547
Level 2

08-09-2018

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,162 likes

Total Posts

6,265 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,162 likes

Total Posts

6,265 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

10-09-2018

This is Sling issue.

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

It is still open.

Answers (3)

Answers (3)

Avatar

Avatar
Validate 10
Level 2
veerareddyc2547
Level 2

Likes

5 likes

Total Posts

36 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
veerareddyc2547
Level 2

Likes

5 likes

Total Posts

36 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 1
View profile
veerareddyc2547
Level 2

10-09-2018

Hi All,

Thanks for your response.

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

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,113 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,113 likes

Total Posts

3,145 posts

Correct Reply

1,072 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

09-09-2018

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

Jörg

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

08-09-2018

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