Closed GoogleCodeExporter closed 9 years ago
From docblock: "This uses a very basic parser easily fooled by comment tokens
inside
strings or regexes" i.e. this is a known limitation. Fixing this for JS would
require a rewrite based on JSMin (preserve all characters, add comments) and
similarly for CSS using a full CSS syntax parser. Sound like fun?
In the case of JS string I think you can work around this with escapes, i.e.
"*\/
\*". Regexps might be harder :(
Original comment by mrclay....@gmail.com
on 3 Oct 2008 at 11:00
I agree that this is nasty and probably not worth fixing. I just don't like
local
changes in libraries like jQuery but I can live with them.
Original comment by Jan.Hend...@googlemail.com
on 4 Oct 2008 at 12:01
Original comment by mrclay....@gmail.com
on 7 Oct 2008 at 3:34
[deleted comment]
Here's a simple patch to stop debug mode inserting errors, instead it will trim
and
combine files rather than add the line # comments:
On line 389 of /min/lib/Minify.php:
http://code.google.com/p/minify/source/browse/tags/release_2.1.1/min/lib/
Minify.php#389
change:
$source->minifier = array('Minify_Lines', 'minify');
to:
$source->minifier = 'trim';
Original comment by mrclay....@gmail.com
on 26 Nov 2008 at 2:39
Issue 71 has been merged into this issue.
Original comment by mrclay....@gmail.com
on 26 Nov 2008 at 2:42
If you replace the line in Lines.php:
$inComment = ! $inComment;
with:
if($pos==0 || ($inComment? substr($line, $pos, 3) : substr($line, $pos-1,
3))!='*/*')
$inComment = ! $inComment;
It's not perfect but at least minify will work with jquery, and I can't think
of any
valid code that would use */*
Original comment by AdamAd...@gmail.com
on 10 Dec 2008 at 2:23
Awesome. Short of rewriting the Lines controller to be a complete JS parser,
this is
a good workaround for a common case. I'll check the unit tests and commit when
I'm
back in town. Thanks!
Original comment by mrclay....@gmail.com
on 10 Dec 2008 at 2:48
Fixed in R275
Original comment by mrclay....@gmail.com
on 16 Dec 2008 at 5:15
Original comment by mrclay....@gmail.com
on 16 Dec 2008 at 5:19
Issue 77 has been merged into this issue.
Original comment by mrclay....@gmail.com
on 21 Jan 2009 at 12:15
Original issue reported on code.google.com by
Jan.Hend...@googlemail.com
on 3 Oct 2008 at 9:55