test inlining

This commit is contained in:
Bruno Rybársky 2024-02-04 11:04:37 +01:00
parent 169afc4ba5
commit 17992f3e16

@ -57,17 +57,12 @@ function minifyCss($css) {
} }
function minifyJs($js) { function minifyJs($js) {
// Remove block comments
//$js = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $js);
// Remove line comments
$js = preg_replace('/\/\/(?![^\'"]*(\'|")[^\'"]*(\'|"))[^\n]*/', '', $js);
// Remove newlines and tabs // Remove newlines and tabs
//$js = str_replace(array("\r\n", "\r", "\n", "\t"), '', $js); $js = str_replace(array(" ", "\t"), '', $js);
// Remove spaces around operators // Remove spaces around operators
$js = preg_replace('~\s*([=+\-*/])\s*~', '$1', $js); //$js = preg_replace('~\s*([=+\-*/])\s*~', '$1', $js);
return trim($js); return trim($js);
} }