diff --git a/src/JS.php b/src/JS.php index c2be733..b3d8f4e 100644 --- a/src/JS.php +++ b/src/JS.php @@ -242,7 +242,7 @@ protected function extractRegex() // (https://github.com/matthiasmullie/minify/issues/56) $operators = $this->getOperatorsForRegex($this->operatorsBefore, '/'); $operators += $this->getOperatorsForRegex($this->keywordsReserved, '/'); - $this->registerPattern('/'.$pattern.'\s*\n?(?=\s*('.implode('|', $operators).'))/', $callback); + $this->registerPattern('/'.$pattern.'\s*\n(?=\s*('.implode('|', $operators).'))/', $callback); } /** diff --git a/tests/js/JSTest.php b/tests/js/JSTest.php index 2fe611f..a423b16 100644 --- a/tests/js/JSTest.php +++ b/tests/js/JSTest.php @@ -868,6 +868,11 @@ function otherFuncName() { }", "if(nutritionalPortionWeightUnit=='lbs'&&blockUnit=='oz'){itemFat=(qty*(fat/nutritionalPortionWeight))/16;itemProtein=(qty*(protein/nutritionalPortionWeight))/16;itemCarbs=(qty*(carbs/nutritionalPortionWeight))/16;itemKcal=(qty*(kcal/nutritionalPortionWeight))/16}", ); + $tests[] = array( + 'itemFat = (qty * (fat/nutritionalPortionWeight))/16; +itemFat = (qty * (fat/nutritionalPortionWeight))/(28.3495*16);', + 'itemFat=(qty*(fat/nutritionalPortionWeight))/16;itemFat=(qty*(fat/nutritionalPortionWeight))/(28.3495*16)', + ); // update tests' expected results for cross-system compatibility foreach ($tests as &$test) {