8000 Merge branch '5.4' into 6.4 · symfony/console@0d9e4eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d9e4eb

Browse files
Merge branch '5.4' into 6.4
* 5.4: [DependencyInjection] Fix computing error messages involving service locators [Serializer] Fix unknown types normalization type when know type [ErrorHandler] Fix parsing messages that contain anonymous classes on PHP >= 8.3.3 [Validator] Review Romanian (ro) translations [Console] Fix display of Table on Windows OS [FrameworkBundle] Fix config builder with extensions extended in `build()` [WebProfilerBundle] disable turbo in web profiler toolbar to avoid link prefetching explicitly cast boolean SSL stream options return the unchanged text if preg_replace_callback() fails the 'use_notify' option is on the factory, not on the postgres connection class review translations
2 parents a9174b6 + 39f75d9 commit 0d9e4eb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Helper/Table.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,10 @@ private function buildTableRows(array $rows): TableRows
637637
if (!str_contains($cell ?? '', "\n")) {
638638
continue;
639639
}
640-
$escaped = implode("\n", array_map(OutputFormatter::escapeTrailingBackslash(...), explode("\n", $cell)));
640+
$eol = str_contains($cell ?? '', "\r\n") ? "\r\n" : "\n";
641+
$escaped = implode($eol, array_map(OutputFormatter::escapeTrailingBackslash(...), explode($eol, $cell)));
641642
$cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped;
642-
$lines = explode("\n", str_replace("\n", "<fg=default;bg=default></>\n", $cell));
643+
$lines = explode($eol, str_replace($eol, '<fg=default;bg=default></>'.$eol, $cell));
643644
foreach ($lines as $lineKey => $line) {
644645
if ($colspan > 1) {
645646
$line = new TableCell($line, ['colspan' => $colspan]);
@@ -701,8 +702,9 @@ private function fillNextRows(array $rows, int $line): array
701702
$nbLines = $cell->getRowspan() - 1;
702703
$lines = [$cell];
703704
if (str_contains($cell, "\n")) {
704-
$lines = explode("\n", str_replace("\n", "<fg=default;bg=default>\n</>", $cell));
705-
$nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines;
705+
$eol = str_contains($cell, "\r\n") ? "\r\n" : "\n";
706+
$lines = explode($eol, str_replace($eol, '<fg=default;bg=default>'.$eol.'</>', $cell));
707+
$nbLines = \count($lines) > $nbLines ? substr_count($cell, $eol) : $nbLines;
706708

707709
$rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]);
708710
unset($lines[0]);

0 commit comments

Comments
 (0)
0