Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
grasmash commentedMar 3, 2021
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. |
carsonbot commentedMar 3, 2021
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 |
stof commentedMar 3, 2021
what if there is extra decoration inside the message ? |
grasmash commentedMar 15, 2021
Not sure what you mean. We're measuring the "decoration" with |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
grasmash commentedMar 16, 2021
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 toca1753bComparenicolas-grekas commentedMar 17, 2021
Thank you@grasmash. |
Decorated text used to be wrapped too early in SymfonyStyle->block()Seesymfony/symfony#40348
Decorated text used to be wrapped too early in SymfonyStyle->block()Seesymfony/symfony#40348The fix was not contributed to version 3, which means we have to rewritethe 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().