49 Commits

Author SHA1 Message Date
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
Matthias Mullie
acfc15b0de Make import media queries work 2014-10-12 21:55:30 +02:00
Matthias Mullie
6f36512148 Alternative workaround for regex requiring recent PCRE 2014-10-12 21:41:25 +02:00
Matthias Mullie
c782c473f9 Improve test coverage for CSS minifier 2014-10-12 21:10:22 +02:00
Matthias Mullie
ed139866fe Make 1 regex instead of a combination of regexes
And slightly fix it, adding test which it failed on:
numbers followed by var-like were incorrectly joined.
2014-10-12 19:41:32 +02:00
Matthias Mullie
f1b565bc99 Improve test coverage & remove redundant code 2014-10-12 17:42:22 +02:00
Matthias Mullie
98f9efd5fc Fix SyntaxError: identifier starts immediately after numeric literal 2014-10-11 02:06:09 +02:00
Matthias Mullie
da1b6a195e Don't remove space between a+ ++b 2014-10-10 08:38:39 +02:00
Matthias Mullie
9f6493e06e Add test for multiple / 2014-10-10 08:18:47 +02:00
Matthias Mullie
52038b1380 Remove target test file, add .gitignore instead
Meanwhile cleaned up one of the tests to have valid CSS in there
2014-10-09 14:23:31 +02:00
Matthias Mullie
ab4ff96048 Fix issue with finding (potentially escaped) regexes 2014-10-09 10:56:39 +02:00
Matthias Mullie
2ee3b4ed70 Properly organize tests 2014-10-09 09:08:21 +02:00
Matthias Mullie
c4a59c904e Make code respect PSR-4 2014-10-09 08:56:14 +02:00
Matthias Mullie
cf9e90ba4a Use PSR4 autoloader; move code to src/ 2014-10-09 08:38:58 +02:00
Matthias Mullie
76734ac3f7 Add PHPUnit dist file, move test files around 2014-10-08 16:34:49 +02:00
Matthias Mullie
36b9b3b543 Fix \-as-division from being interpreted as regex
Fixes issue #14
2014-10-08 10:54:11 +02:00
Matthias Mullie
3750e33d49 Add tests for issue #15 2014-10-08 10:20:42 +02:00
Matthias Mullie
3135b0fcb2 Other approach: don't add semicolons, just keep newline when in doubt 2014-10-08 09:57:41 +02:00
Matthias Mullie
9fa994fda6 Add comma as operator 2014-10-07 19:49:16 +02:00
Matthias Mullie
6a864c8c7c Major JS minifier rewrite 2014-10-07 18:21:22 +02:00
Matthias Mullie
b711882b23 Some more improvements 2013-12-27 02:12:53 +01:00
Matthias Mullie
30797d8420 Improved JS minifier
Meanwhile also (somewhat forced by improving JS minifier) removed minifier
options. They were kind of useless anyway, though; why would one not minify
completely :)
2013-12-27 00:00:46 +01:00
Matthias Mullie
b9a11ae3a6 More advanced whitespace stripping
Should now accurately strip newlines and add ; line-terminators where needed.

Meanwhile also introduced Minify\JS::STRIP_SEMICOLONS to strip redundant
semicolons.
2013-12-26 20:40:20 +01:00
Matthias Mullie
1ea4573dc0 Escaped quote should not terminate string 2013-12-26 20:40:20 +01:00
Matthias Mullie
5a98aab7b7 Fix https://github.com/matthiasmullie/minify/issues/11
Meanwhile, fix some whitespace
2013-12-01 23:48:06 +01:00
Matthias Mullie
4d6a3c8483 Serious (JS) code refactor
Meanwhile fixed issue https://github.com/matthiasmullie/minify/issues/10
2013-12-01 23:25:54 +01:00
Matthias Mullie
1cd2718da4 Fix whitespace; spaces instead of tabs 2013-04-22 10:19:35 +02:00
Matthias Mullie
5ff011d577 Add test for double backslash CSS
Issue was reported at https://github.com/forkcms/forkcms/issues/387
2013-04-22 10:16:03 +02:00
Matthias Mullie
622b021aaf Better function name in tests 2013-04-15 14:37:31 +02:00
Matthias Mullie
22b7734582 Fix files' case 2013-04-15 00:00:23 +02:00
Matthias Mullie
9c646aee68 Big 1.1.0 cleanup
* PSR-0 & PSR-1
* Add test suite
* Multiple smaller fixes/cleanup
2013-04-14 23:38:24 +02:00