crowell / modpagespeed_tmp

Automatically exported from code.google.com/p/modpagespeed
Apache License 2.0
0 stars 0 forks source link

collapse_whitespace filter don't remove excess whitespace from meta description tag value #592

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.create html page with following meta tag:
<meta name="description" content=" 

        fooooo 

          barbarbar barbarbar">
2. ModPagespeedEnableFilters collapse_whitespace
3. fetch the page

What is the expected output? What do you see instead?
I'd expect to see this:
<meta name="description" content="fooooo barbarbar barbarbar">
instead i still have original value with whitespaces.

What version of the product are you using (please check X-Mod-Pagespeed
header)?
X-Mod-Pagespeed:1.1.23.2-2191
On what operating system?
ubuntu server 12.04
Which version of Apache?
2.2.22
Which MPM?
Worker
URL of broken page:
can't tell.

background: this meta value is caused by a feature, which puts beginning of 
article into meta description. unfortunately, source of article contains a lot 
of markup, and code which removes markup, leaves out spaces and new lines.
I don't know if it can break anything in terms of SERP snippet if we remove 
spaces and newlines.

Original issue reported on code.google.com by l...@critical.pl on 12 Dec 2012 at 3:30

GoogleCodeExporter commented 9 years ago
This is not the goal of collapse whitespace. As far as I know, whitespace 
inside of tag attribute values can be significant, we have no way of knowing 
that this whitespace is not significant.

Original comment by sligocki@google.com on 12 Dec 2012 at 4:33

GoogleCodeExporter commented 9 years ago
ok, looks like there is no specs for this value 
http://www.w3.org/TR/html401/struct/global.html#adef-content so you are right.

Original comment by l...@critical.pl on 12 Dec 2012 at 5:03