Skip to content

Commit 7cd02a9

Browse files
committed
Cleanup
1 parent 74bbb37 commit 7cd02a9

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

tests/CssInlinerPluginTest.php

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -253,25 +253,12 @@ protected function normalize(string $html): string
253253
$normalizedHtml = trim($document->saveHTML());
254254

255255
$search = [
256-
// '/(?:<html>)(\s)+(?:<head>)/s', // libxml handles this different across platforms
257-
'/(?:<head>)(\s)+(?:<\/head>)/s', // libxml handles this different across platforms
258-
// '/(?:<\/head>)(\s)+(?:<style>)/s', // libxml handles this different across platforms
259-
// '/(?:<\/head>)(\s)+(?:<style>)/s', // libxml handles this different across platforms
260-
// '/\>[^\S ]+/s', // strip whitespaces after tags, except space
261-
// '/[^\S ]+\</s', // strip whitespaces before tags, except space
262-
// '/(\s)+/s', // shorten multiple whitespace sequences
263-
// '/<!--(.|\s)*?-->/', // Remove HTML comments
264-
];
265-
266-
$replace = [
267-
// '<html><head>',
268-
'<head></head>',
269-
// '</head><style>',
270-
// '>',
271-
// '<',
272-
// '\\1',
273-
// '',
274-
];
256+
'/(?:<head>)(\s)+(?:<\/head>)/s', // libxml handles this different across platforms
257+
];
258+
259+
$replace = [,
260+
'<head></head>',
261+
];
275262

276263
return trim(preg_replace($search, $replace, $normalizedHtml));
277264
}

0 commit comments

Comments
 (0)