From 6c03cdca09179c2d700fb3af66c93b4b9d7b54be Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns Date: Mon, 24 Jan 2022 10:55:41 +0100 Subject: [PATCH] Update wyrihaximus/html-compress to 4.0 --- Classes/CompressionHelper.php | 20 ++++++++++++-------- composer.json | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) 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": {