Skip to content

Commit 5c016a1

Browse files
authored
Merge pull request #7 from andremacola/master
fix: exception on minify empty style
2 parents a5a94ad + 5a3a961 commit 5c016a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tokens/tag.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ public function minify(array $minify) : void {
516516
$attributes[$key] = null;
517517

518518
// minify style tag
519-
} elseif ($key === 'style' && $minify['attributes']['style']) {
519+
} elseif ($key === 'style' && $minify['attributes']['style'] && !empty($attributes[$key])) {
520520
$attributes[$key] = \trim(\str_replace(
521521
[' ', ' : ', ': ', ' :', ' ; ', ' ;', '; '],
522522
[' ', ':', ':', ':', ';', ';', ';'],

0 commit comments

Comments
 (0)