Skip to content

Commit 1e8a50d

Browse files
committed
Merge remote-tracking branch 'tango/MC-36942' into MPI-2020-09-14
2 parents b6114f0 + 87434e6 commit 1e8a50d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/internal/Magento/Framework/View/Template/Html/Minifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function ($match) use (&$heredocs) {
144144
'#(?<!:|\\\\|\'|"|/)//(?!/)(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',
145145
'',
146146
preg_replace(
147-
'#(?<!:|\'|")//[^\n\r]*(\?\>)#',
147+
'#(?<!:|\'|")//[^\n\r<]*(\?\>)#',
148148
' $1',
149149
preg_replace(
150150
'#(?<!:)//[^\n\r]*(\<\?php)[^\n\r]*(\s\?\>)[^\n\r]*#',

lib/internal/Magento/Framework/View/Test/Unit/Template/Html/MinifierTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public function testMinify()
140140
<a href="http://somelink.com/text.html">Text Link</a>
141141
<img src="test.png" alt="some text" />
142142
<?php echo \$block->someMethod(); ?>
143+
<img src="data:image/gif;base64,P///yH5BAEAAAA" data-component="main-image"><?= \$block->someMethod(); ?>
143144
<div style="width: 800px" class="<?php echo \$block->getClass() ?>" />
144145
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-component="main-image">
145146
<script>
@@ -182,7 +183,7 @@ public function testMinify()
182183
TEXT;
183184

184185
$expectedContent = <<<TEXT
185-
<?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(); ?> <div style="width: 800px" class="<?php echo \$block->getClass() ?>" /><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-component="main-image"><script>
186+
<?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>
186187
var i = 1;
187188
var j = 1;
188189

0 commit comments

Comments
 (0)