Skip to content

Commit 312971d

Browse files
committed
Add step in HTML driver to normalize windows line endings
1 parent 64203a4 commit 312971d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Drivers/HtmlDriver.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ public function serialize($data): string
2121

2222
@$domDocument->loadHTML($data); // to ignore HTML5 errors
2323

24-
return $domDocument->saveHTML();
24+
$htmlValue = $domDocument->saveHTML();
25+
// Normalize line endings for cross-platform tests.
26+
if (PHP_OS_FAMILY === 'Windows') {
27+
$htmlValue = implode("\n", explode("\r\n", $htmlValue));
28+
}
29+
30+
return $htmlValue;
2531
}
2632

2733
public function extension(): string

0 commit comments

Comments
 (0)