Skip to content

Commit f5bef7e

Browse files
authored
Merge pull request #136 from mallardduck/win-eol-fix-html
Normalize windows line endings on HTML tests
2 parents 64203a4 + 312971d commit f5bef7e

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)