Skip to content

[Console] [Table] Fix unnecessary wrapping #61268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

schlndh
Copy link
Contributor

@schlndh schlndh commented Jul 30, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

This PR fixes unnecessary wrapping of Table cells which contain newlines.

Example:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$table = new \Symfony\Component\Console\Helper\Table($output);
$table->setColumnMaxWidth(0, 20);
$table->addRow(["First line: <info>1234</info>\nSecond line: 4568"]);
$table->render();
6.4 This PR
symfony_table_64 symfony_table_fixed

@schlndh schlndh requested a review from chalasr as a code owner July 30, 2025 09:51
@carsonbot carsonbot added this to the 6.4 milestone Jul 30, 2025
@carsonbot carsonbot changed the title [Console][Table] Fix unnecessary wrapping [Console] [Table] Fix unnecessary wrapping Jul 30, 2025
@schlndh schlndh force-pushed the fix-unnecessaryConsoleWrapping branch from 45fe9eb to 441ee73 Compare July 30, 2025 10:39
@nicolas-grekas
Copy link
Member

Thank you @schlndh.

@nicolas-grekas nicolas-grekas merged commit 131f7d2 into symfony:6.4 Jul 30, 2025
10 of 11 checks passed
@schlndh schlndh deleted the fix-unnecessaryConsoleWrapping branch July 30, 2025 12:17
This was referenced Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants