Jeff-Lewis / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Minify_CSS breaks unusual but valid strings #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently each string of whitespace is collapsed to a single space. 

This breaks strings (as content values or in attribute selectors) that may 
contain two or more consecutive spaces, and strings continued on the next 
line. E.g.:

foo[attr="two  spaces"] { content: "\"Really\" Anno\
ying"; }

becomes:

foo[attr="two spaces"]{content:"\"Really\" Anno\ ying"}

Parsing strings by the spec (then preserving them while the rest is 
minified) would be possible if you could reliably identify the starting 
position. I suppose =" and content: would be good places to look.

It might be easier to not rely on the initial whitespace collapse. There 
is a lot of ws stripping going on and the collapse may be redundant. It 
might be worth losing a few bytes of minification to never run into this 
issue.

Original issue reported on code.google.com by mrclay....@gmail.com on 14 Aug 2008 at 5:05

GoogleCodeExporter commented 9 years ago
Fixed in R171! No longer compressing all whitespace to spaces.

Original comment by mrclay....@gmail.com on 14 Aug 2008 at 6:20