From 17992f3e16f7926c47101627dc0a4e74ab39ec60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sun, 4 Feb 2024 11:04:37 +0100 Subject: [PATCH] test inlining --- lib/inliner.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/inliner.php b/lib/inliner.php index a3ef87b..7a41f51 100644 --- a/lib/inliner.php +++ b/lib/inliner.php @@ -57,17 +57,12 @@ function minifyCss($css) { } function minifyJs($js) { - // Remove block comments - //$js = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $js); - - // Remove line comments - $js = preg_replace('/\/\/(?![^\'"]*(\'|")[^\'"]*(\'|"))[^\n]*/', '', $js); // Remove newlines and tabs - //$js = str_replace(array("\r\n", "\r", "\n", "\t"), '', $js); + $js = str_replace(array(" ", "\t"), '', $js); // Remove spaces around operators - $js = preg_replace('~\s*([=+\-*/])\s*~', '$1', $js); + //$js = preg_replace('~\s*([=+\-*/])\s*~', '$1', $js); return trim($js); } \ No newline at end of file