Matthias Mullie
49a2aca294
Allow minified data to be written to cache
2015-05-05 16:43:08 +02:00
Matthias Mullie
90837a6886
Don't replace while
if it's part of a do-while
...
Fixes issue #50
2015-05-05 16:27:10 +02:00
Matthias Mullie
e26263e566
Add test for issue #49
2015-05-05 14:52:16 +02:00
Matthias Mullie
30a459229f
Add gzip method
...
Fixed #47
2015-04-07 15:47:36 +02:00
Matthias Mullie
2a70744313
Shorten while(true) to for(;;)
2015-04-07 15:35:03 +02:00
Matthias Mullie
ecd1a04d88
Allow for-loops with empty bodies
...
Fixed #42
2015-04-07 15:26:37 +02:00
Matthias Mullie
e15f77b7f6
Don't convert standalone arrays
...
"return" looks like it could be a variable of which ['x']
is a key. I've improved the code to also check for keywords.
If whatever preceeds it is one of the keywords, don't convert.
Fixes issue #44
2015-03-12 16:11:36 +01:00
Matthias Mullie
0916262056
Don't override already restored data
...
Fixes issue #43
2015-03-10 10:01:13 +01:00
Matthias Mullie
d34af3d323
php-cs-fixer fixes
2015-03-06 13:17:33 +01:00
Matthias Mullie
86448c21ac
Fix recursive relative path resolving
...
I had to split the action of minification into a separate
method because recursively importing files requires them
to also be minified, and I don't want that one to write
to a file.
2015-03-06 12:01:30 +01:00
Matthias Mullie
22dbb726a0
Don't strip double semicolons before )
...
Fixes #40
2015-02-26 09:07:21 +01:00
Matthias Mullie
778c63c8eb
Don't replace reserved words by property notation
...
Fixes #41
2015-02-26 08:41:17 +01:00
Matthias Mullie
5114e7f22c
Add tests for issue #39
...
Fixes issue #39
2015-02-20 17:27:10 +01:00
Matthias Mullie
4aa0c8872b
Everything should extract strings first & goe through move
...
* Let everything go through move(), even if the file is not being
written elsewhere (it also does some cleanup)
* Reorder minify statements: string/comment parsing should come first
* Update test with url() that makes no sense
* Update same test to escape as intended (double-escape would’ve been needed)
2015-02-20 17:24:53 +01:00
Matthias Mullie
227efa7bf8
Don't touch relative paths if no target path is given
...
Fixes issue #38
2015-02-20 17:05:08 +01:00
Matthias Mullie
3528c67597
Get rid of any ; before }
...
Fixes issue #37
2015-02-16 21:12:33 +01:00
Matthias Mullie
434d0125e6
Fix coding standard violations
...
Thanks, php-cs-fixer
2015-02-12 13:34:50 +01:00
Matthias Mullie
5d1886a2ef
Add a newline between scripts being joined
...
Fixes issue #35
2015-02-06 11:14:06 +01:00
Matthias Mullie
471f982e63
Improve string extraction
...
Test to check if ending string delimiter is escaped was flawed.
2015-02-03 18:27:30 +01:00
Matthias Mullie
f54f58d8b1
Don't strip whitespace after ++ or --
2015-02-02 19:28:35 -08:00
Matthias Mullie
3acd3c3a9b
Don't eat \n following a single-line comment
...
It may be needed for ASI to kick in
2015-02-02 16:11:52 -08:00
Matthias Mullie
b0cd6f5e0a
Add test for issue #33
2015-02-02 15:29:57 -08:00
Matthias Mullie
09c6c5ef72
Shorten booleans: !0 and !1
2015-02-01 12:21:27 -08:00
Matthias Mullie
26271a6c4a
Also preserve backtick-encapsulated strings
...
Backticks can also be used for a string: it's a special
kind of string that allows string interpolation.
2015-01-24 18:24:47 -08:00
Matthias Mullie
a803426906
Don't strip zero-less units
...
em is not only a unit, it's also an element, so it can be
(part of) a selector.
The regex was incomplete as it would be stripping 'em'
occurences even if it's not immediately preceded by 0
(because of the many for a 0 can come in: -0, 0, .0, ...)
Fixes bug #31
2015-01-23 09:15:25 -08:00
Matthias Mullie
8f12edd022
Fix propertyNotation forced on simple 1-key arrays
...
Fixes bug #31
2015-01-23 08:58:52 -08:00
Matthias Mullie
e2ee427f26
Fix propertyNotation regex
2015-01-11 17:39:46 +01:00
Matthias Mullie
b45004a092
Don't mess up when there's whitespace between url( and ['"]
...
Fixed issue #29
2015-01-09 14:41:14 +01:00
Matthias Mullie
2ef177940e
Stricter checking when replacing 0-like values
2015-01-09 13:24:48 +01:00
Matthias Mullie
8f38d48a38
Fix propertyNotation
...
I originally executed this on content where string had not yet been replaced.
Because this could cause false positives and match content inside strings, I
switched it to be executed after strings had been extracted.
However, this means those array key texts were also replaced, by something that
always looks like a valid variable. I've now moved that check to match the
extracted value, which we'll be replacing.
2015-01-09 11:19:24 +01:00
Matthias Mullie
620f98fd09
Fix issue 26
2015-01-07 12:13:43 +01:00
Matthias Mullie
9c160601ad
Replaces all occurrences of array['key'] by array.key
2014-12-31 16:07:08 +01:00
Matthias Mullie
e13143b35c
Limit what zeroes can be truncated
2014-12-07 18:35:07 +01:00
Matthias Mullie
609c6f4cfc
Don't collapse zeroes in hex color values
2014-12-07 14:02:46 +01:00
Matthias Mullie
e1d4a6e43f
Improve zero-value shortening
...
Fixes issue #24
2014-12-05 14:34:27 +01:00
Matthias Mullie
d1dcea7ef1
Add units that are allowed to be stripped for zero-valies
2014-12-04 20:09:49 +01:00
Matthias Mullie
f5d1bd2c9a
Don't strip minus in 0 with digits
2014-12-04 20:08:57 +01:00
Matthias Mullie
2ddefccaf8
Shorten zero-values
2014-11-20 21:42:49 +01:00
Matthias Mullie
06da58831b
Whitespace around - and + can't always just be stripped
2014-11-20 21:39:05 +01:00
Matthias Mullie
4b5f6d3e17
Handle relative from & to paths in path conversion
2014-10-30 10:43:48 +01:00
Matthias Mullie
5bbd856b02
Improve CSS minifier, add some whitespace rules
...
Meanwhile also moved to use the same method JS does to
extract strings, which allows us to be more agressive on
stripping whitespace.
2014-10-30 10:16:31 +01:00
Matthias Mullie
0354803254
Get rid of leftover rubbish
2014-10-29 17:51:15 +01:00
Matthias Mullie
8378037ee4
Add tests for recent issues
2014-10-20 11:08:51 +02:00
Matthias Mullie
7b5abfe181
Seperate JS files by ; & more thorough checking for ++ & --
2014-10-14 11:30:23 +02:00
Matthias Mullie
a3b43938c0
Simplify convertRelativePath
2014-10-13 13:46:16 +02:00
Matthias Mullie
a2c2c1f01b
No longer move char by char
...
Let the regexes find, then only replace first match. This
makes us move in whole batches at once (though regexes will
become a bit slower, now having to match not just first char)
2014-10-13 10:10:47 +02:00
Matthias Mullie
2279df75f8
Operate on arrays when resolving relative paths
...
Instead of relying on do/while loops & regular expressions.
2014-10-13 08:43:55 +02:00
Matthias Mullie
07c1bd1e3a
Test common methods
...
Meanwhile also fix appending of multiple JS sources:
they should be split by line feed.
2014-10-12 22:27:53 +02:00
Matthias Mullie
38ad5cf0de
Add tests for relative paths in CSS
2014-10-12 22:07:59 +02:00
Matthias Mullie
0b44d82991
Add test for absolute path in CSS
...
Meanwhile fixed conditions to import file; shouldn't be
&=, as that doesn't short-circuit the and (it still executes)
2014-10-12 22:01:13 +02:00