You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…) (chalasr, ogizanagi)
This PR was merged into the 2.7 branch.
Discussion
----------
[Console] Fix question formatting using SymfonyStyle::ask()
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #20964
| License | MIT
| Doc PR | n/a
Given
```php
$io = new SymfonyStyle($input, $output);
$io->ask('Do you want to use Foo\\Bar <comment>or</comment> Foo\\Baz\\?', 'Foo\\Bar');
```
Before output

After output

Commits
-------
e189183 [Console] SymfonyStyle: Escape trailing backslashes in user texts
9d46712 [Console] Fix question formatting using SymfonyStyle::ask()
I'm very late to the Symfony 3 upgrade game, but in comparison to Symfony 2.8, this code behaves differently:
Expected output is that the word "something" has a different color, instead the output is as follows:
This is due to this commit. From the tests, it seems like the escape was added just for backslashes and not really intended to also escape formatting.
Maybe this is too late into Symfony 3 to change this behavior, but it is handy to be able to emphasize words in questions.
The text was updated successfully, but these errors were encountered: