diff --git a/lib/internal/Magento/Framework/View/Template/Html/Minifier.php b/lib/internal/Magento/Framework/View/Template/Html/Minifier.php index 6caa6e455633f..0759a6873a9f1 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 3ca76f2208dc3..0452636f7d4d5 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 @@ -155,6 +155,11 @@ public function testMinify() inline text + getSomeVariable() > 1):?> + getChildHtml('someChildBlock'); ?> + + getChildHtml('anotherChildBlock'); ?> + TEXT; @@ -178,7 +183,7 @@ public function testMinify() } }); //]]> - inline text + inline text getChildHtml('someChildBlock'); ?> TEXT; $this->appDirectoryMock->expects($this->once())