File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
lib/internal/Magento/Framework/View Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,11 @@ public function minify($file)
131
131
preg_replace (
132
132
'#(?<!:)//[^\n\r]*(\s\?\>)# ' ,
133
133
'$1 ' ,
134
- $ this ->rootDirectory ->readFile ($ file )
134
+ preg_replace (
135
+ '#//[^\n\r]*(\<\?php)[^\n\r]*(\s\?\>)[^\n\r]*# ' ,
136
+ '' ,
137
+ $ this ->rootDirectory ->readFile ($ file )
138
+ )
135
139
)
136
140
)
137
141
)
Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ public function testMinify()
98
98
<?php echo \$block->someMethod(); ?>
99
99
<div style="width: 800px" class="<?php echo \$block->getClass() ?>" />
100
100
<script>
101
+ var i = 1;// comment
102
+ var j = 1;// <?php echo 'hi' ?>
103
+ //<?php ?> ')){
104
+ // if (<?php echo __('hi')) { ?>
101
105
//<![CDATA[
102
106
var someVar = 123;
103
107
testFunctionCall(function () {
@@ -118,6 +122,10 @@ public function testMinify()
118
122
119
123
$ expectedContent = <<<TEXT
120
124
<?php /** * Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details. */ ?> <?php ?> <html><head><title>Test title</title></head><body><a href="http://somelink.com/text.html">Text Link</a> <img src="test.png" alt="some text" /><?php echo \$block->someMethod(); ?> <div style="width: 800px" class="<?php echo \$block->getClass() ?>" /><script>
125
+ var i = 1;
126
+ var j = 1;
127
+
128
+
121
129
//<![CDATA[
122
130
var someVar = 123;
123
131
testFunctionCall(function () {
You can’t perform that action at this time.
0 commit comments