From 1d1b31f035412b8440eeb1a0c4323a0f63db8826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sun, 4 Feb 2024 10:55:12 +0100 Subject: [PATCH] test inlining --- lib/inliner.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/inliner.php b/lib/inliner.php index 8ee1d41..325fba1 100644 --- a/lib/inliner.php +++ b/lib/inliner.php @@ -57,9 +57,12 @@ function minifyCss($css) { } function minifyJs($js) { - // Remove comments + // Remove block comments $js = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $js); + // Remove line comments + $js = preg_replace('!(//.*)|(/\*.*?\*/)!s', '', $js); + // Remove newlines and tabs $js = str_replace(array("\r\n", "\r", "\n", "\t"), '', $js);