-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Fix line wrapping for decorated text in block output #40348
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
Conversation
Quick before and after:
Notice that after, we are correctly filling the line with text up to 120 chars as expected. Before, the words were wrapped too early. |
Hey! I like what you have done here. Keep up the good work. I think @Simperfit has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
what if there is extra decoration inside the message ? |
Not sure what you mean. We're measuring the "decoration" with |
I'd like to note that while this PR improves the situation, it's still not perfect. The correct solution would actually be to follow the example of formatAndWrap() and actually parse the string one character at a time to wrap the line while not breaking a tag. I looked into using formatAndWrap(), but it's problematic. We really need the wrap aspect of it and not the format aspect. |
ff051ea
to
ca1753b
Compare
Thank you @grasmash. |
Decorated text used to be wrapped too early in SymfonyStyle->block() See symfony/symfony#40348
Decorated text used to be wrapped too early in SymfonyStyle->block() See symfony/symfony#40348 The fix was not contributed to version 3, which means we have to rewrite the test so that it passes for both the correct and the buggy version.
Fixed bug that caused decorated text to be wrapped too early in SymfonyStyle->block().