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);