jalmenarez / minify

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

Minify 2.1 adds line breaks breaking 'Page' output #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version:2.1
PHP version:5.2.4

What steps will reproduce the problem?
1. Make any long string in a page you're minifying that has a javascript
string with spaces in it, e.g  var blah=" asldf asf jasfl jasfl asfla
sflajflajflasjflafasdflasjf asdflasjf alsf jalfj aslfj asd"; 
2. Minify breaks it up for some reasons even though it wasn't broken up
before causing unterminated string

The previous version did not do this.

Also, it would be nice if you mentioned that you changed the function names
and option names (e.g. useServerCache is now  setCache()).

Love minify, keep up the good work and Thanks!

Original issue reported on code.google.com by joesiegr...@gmail.com on 25 Sep 2008 at 1:50

GoogleCodeExporter commented 9 years ago
It looks like lines 95 and 96 should be moved before line 87.
http://code.google.com/p/minify/source/browse/tags/release_2.1.0/min/lib/Minify/
HTML.php#95
Can you see if this change fixes the problem?

Some of the unit tests might need some adjustments but it shouldn't break any 
functionality.

Original comment by mrclay....@gmail.com on 25 Sep 2008 at 3:12

GoogleCodeExporter commented 9 years ago
That resolves it on my test case; it seems like you've added an easy debug 
mode, so 
is there any reason to introduce newlines?

Original comment by joesiegr...@gmail.com on 25 Sep 2008 at 3:42

GoogleCodeExporter commented 9 years ago
The debug mode is strictly for languages with C style comments (JS + CSS). I 
guess 
for HTML it should just turn all minification off. I'll have to check on that.

Extra newlines were added due to an option in YUI Compressor that mentioned 
issues 
with extreme line lengths (one Minify user had a single line over 50000 
characters). 
Opening tags with attributes seemed like the safest place to put them without 
adding 
any bytes.

Original comment by mrclay....@gmail.com on 25 Sep 2008 at 11:34

GoogleCodeExporter commented 9 years ago
Makes sense, thanks for your help.  You're welcome to add https://lastpass.com/ 
to 
the list of sites using minify.  

Original comment by joesiegr...@gmail.com on 25 Sep 2008 at 3:26

GoogleCodeExporter commented 9 years ago
Fixed in R239

Original comment by mrclay....@gmail.com on 27 Sep 2008 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by mrclay....@gmail.com on 7 Oct 2008 at 3:36