diff --git a/Classes/CompressionHelper.php b/Classes/CompressionHelper.php index 0f797af..0a39847 100644 --- a/Classes/CompressionHelper.php +++ b/Classes/CompressionHelper.php @@ -1,42 +1,46 @@ parser = Factory::construct(); + $htmlMin = new HtmlMin(); + // TODO this makes it not break the cache markers, but compresses less (or not at all?) + $htmlMin->doOptimizeViaHtmlDomParser(false); + $this->compressor = Factory::constructSmallest()->withHtmlMin($htmlMin); } /** * Run the value through the compressor. * * @param string $content - * * @return string */ - public function compress($content) + public function compress(string $content): string { - return $this->parser->compress($content); + return $this->compressor->compress($content); } /** * All methods are considered safe, i.e. can be executed from within Eel * * @param string $methodName - * * @return boolean */ public function allowsCallOfMethod($methodName) diff --git a/composer.json b/composer.json index 0204872..464bae1 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,8 @@ "description": "Output compression for Neos", "license": "MIT", "require": { - "neos/neos": "^5.0 || ^7.0", - "wyrihaximus/html-compress": "~1.2" + "neos/neos": "^5.3 || ^7.0", + "wyrihaximus/html-compress": "^4.0" }, "autoload": { "psr-4": {