File tree Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Expand file tree Collapse file tree 1 file changed +6
-19
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments