diff --git a/lib/internal/Magento/Framework/View/Template/Html/Minifier.php b/lib/internal/Magento/Framework/View/Template/Html/Minifier.php index 0e25331a1e687..796cc8bef0f28 100644 --- a/lib/internal/Magento/Framework/View/Template/Html/Minifier.php +++ b/lib/internal/Magento/Framework/View/Template/Html/Minifier.php @@ -131,8 +131,8 @@ public function minify($file) '#(?)[^\n\r]*#', '', preg_replace( - '#(?)#', - '$1', + '#(?)#', + ' $1', preg_replace( '#(?)[^\n\r]*#', '', diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php index 53b7fe827376f..f07f7f4bdd8c1 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php @@ -156,6 +156,11 @@ public function testMinify() inline text + getSomeVariable() > 1):?> + getChildHtml('someChildBlock'); ?> + + getChildHtml('anotherChildBlock'); ?> + TEXT; @@ -179,7 +184,7 @@ public function testMinify() } }); //]]> - inline text + inline text getChildHtml('someChildBlock'); ?> TEXT; $this->appDirectoryMock->expects($this->once())