Skip to content

Commit

Permalink
extra fix for calc whitespace perservation
Browse files Browse the repository at this point in the history
cfr. 'seems like it fixes "- (" but not ") -"' in
tubalmartin/YUI-CSS-compressor-PHP-port#22 (comment)
  • Loading branch information
futtta committed Oct 4, 2016
1 parent a18ea9a commit 685d76b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/external/php/yui-php-cssmin-2.4.8-4_fgo.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ private function replace_colon($matches)

private function replace_calc($matches)
{
$this->preserved_tokens[] = preg_replace('/([\+\-]{1})\(/','$1 (',trim(preg_replace('/\s*([\*\/\(\),])\s*/', '$1', $matches[2])));
$this->preserved_tokens[] = preg_replace('/\)([\+\-]{1})/',') $1',preg_replace('/([\+\-]{1})\(/','$1 (',trim(preg_replace('/\s*([\*\/\(\),])\s*/', '$1', $matches[2]))));
return 'calc('. self::TOKEN . (count($this->preserved_tokens) - 1) . '___' . ')';
}

Expand Down

0 comments on commit 685d76b

Please sign in to comment.