adding white spaces in page view source

Avatar

Avatar

veerareddyc2547

Avatar

veerareddyc2547

veerareddyc2547

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

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.8K

Likes

1.0K

Correct Reply

1.1K
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

veerareddyc2547

Avatar

veerareddyc2547

veerareddyc2547

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

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

996

Correct Reply

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

996

Correct Reply

1.0K
Jörg_Hoh
Employee

09-09-2018

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

Jörg

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

861

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

861
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