Skip to content

Commit a9174b6

Browse files
bug #54009 [Console] Fix display of vertical Table on Windows OS (VincentLanglet)
This PR was merged into the 6.4 branch. Discussion ---------- [Console] Fix display of vertical Table on Windows OS | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT Similar to symfony/symfony#54001 but the feature was introduced in 6.4 with symfony/symfony#50691 Commits ------- e9b0faaec5 Fix vertical table on windows
2 parents cb3239f + 155f2f3 commit a9174b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Helper/Table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ public function render()
365365
for ($i = 0; $i < $maxRows; ++$i) {
366366
$cell = (string) ($row[$i] ?? '');
367367

368-
$parts = explode("\n", $cell);
368+
$eol = str_contains($cell, "\r\n") ? "\r\n" : "\n";
369+
$parts = explode($eol, $cell);
369370
foreach ($parts as $idx => $part) {
370371
if ($headers && !$containsColspan) {
371372
if (0 === $idx) {

0 commit comments

Comments
 (0)