@@ -173,7 +173,7 @@ public function testMinify(): void
173
173
<?php echo '//some.link.com/' ?>
174
174
<em>inline text</em>
175
175
<a href="http://www.<?php echo 'hi' ?>"></a>
176
- <?php// if ( \$block->getSomeVariable() > 1):?>
176
+ <?php // if ( \$block->getSomeVariable() > 1):?>
177
177
<?php echo \$block->getChildHtml('someChildBlock'); ?>
178
178
<?php //else:?>
179
179
<?php // echo \$block->getChildHtml('anotherChildBlock'); ?>
@@ -190,6 +190,12 @@ public function testMinify(): void
190
190
// This is not a comment and should be preserved.
191
191
// This is not a comment <?= 'either.' ?>
192
192
</div>
193
+ <textarea>
194
+ Spaces in textareas
195
+ are significant and
196
+ should not be removed.
197
+ </textarea>
198
+ This is HTML : <?php//
193
199
<?php
194
200
\$someothertext = <<<SOMEOTHERTEXT
195
201
mytext
@@ -202,7 +208,7 @@ public function testMinify(): void
202
208
TEXT ;
203
209
204
210
$ expectedContent = <<<TEXT
205
- <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ ?> <?php ?> <html><head><title>Test title</title></head><link rel="stylesheet" href='https://www.example.com/2' type="text/css" /><link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/1" type="text/css" /><body><a href="http://somelink.com/text.html">Text Link</a> <img src="test.png" alt="some text" /><?php echo \$block->someMethod(); ?> <img src="data:image/gif;base64,P///yH5BAEAAAA" data-component="main-image"><?= \$block->someMethod(); ?> <div style="width: 800px" class="<?php echo \$block->getClass() ?>" /><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-component="main-image"><script>
211
+ <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** multi line comment containing a <span> */ echo 'test'; ?> <html><head><title>Test title</title></head><link rel="stylesheet" href='https://www.example.com/2' type="text/css" /><link rel="stylesheet" type="text/css" media="all" href="https://www.example.com/1" type="text/css" /><body><a href="http://somelink.com/text.html">Text Link</a> <img src="test.png" alt="some text" /><?= \$block->someMethod() ?> <img src="data:image/gif;base64,P///yH5BAEAAAA" data-component="main-image"><?= \$block->someMethod() ?> <div style="width: 800px" class="<?= \$block->getClass() ?>" /><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-component="main-image"><script>
206
212
var i = 1;
207
213
var j = 1;
208
214
@@ -215,15 +221,26 @@ public function testMinify(): void
215
221
return {
216
222
'someProperty': test,
217
223
'someMethod': function () {
218
- alert(<?php echo \$block->getJsAlert() ?>);
224
+ alert(<?= \$block->getJsAlert() ?>);
219
225
}
220
226
}
221
227
});
222
228
//]]>
223
- </script><?php echo "http://some.link.com/" ?> <?php echo "//some.link.com/" ?> <?php echo '//some.link.com/' ?> <em>inline text</em> <a href="http://www.<?php echo 'hi' ?>"></a> <?php ?> <?php echo \$block->getChildHtml('someChildBlock'); ?> <?php ?> <?php ?> <?php ?></body><?php \$sometext = <<<SOMETEXT
229
+ </script><?= "http://some.link.com/" ?> <?= "//some.link.com/" ?> <?= '//some.link.com/' ?> <em>inline text</em> <a href="http://www.<?= 'hi' ?>"></a> <?php ?> <?= \$block->getChildHtml('someChildBlock') ?> <?php ?> <?php ?> <?php ?></body><?php \$sometext = <<<SOMETEXT
224
230
mytext
225
231
mytextline2
226
- SOMETEXT; ?></html>
232
+ <span> </span>
233
+ SOMETEXT
234
+ ;?> <div> // This is not a comment and should be preserved. // This is not a comment <?= 'either.' ?></div><textarea>
235
+ Spaces in textareas
236
+ are significant and
237
+ should not be removed.
238
+ </textarea> This is HTML : <?php// <?php \$someothertext = <<<SOMEOTHERTEXT
239
+ mytext
240
+ { \$block->getChildHtml('someChildBlock')}
241
+ <span> </span>
242
+ SOMEOTHERTEXT
243
+ ;?></html>
227
244
TEXT ;
228
245
229
246
$ this ->appDirectoryMock ->expects ($ this ->once ())
0 commit comments