Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] SymfonyQuestionHelper escapes formatting in question prompts #20964

Closed
@polothy

Description

@polothy
Q A
Bug report? yes
Feature request? no
BC Break report? yes (I think?)
RFC? no
Symfony version 3.2.1

I'm very late to the Symfony 3 upgrade game, but in comparison to Symfony 2.8, this code behaves differently:

$io = new SymfonyStyle($input, $output);
$io->confirm('Are you sure you want to <comment>something</comment>');

Expected output is that the word "something" has a different color, instead the output is as follows:

Are you sure you want to <comment>something</comment> (yes/no) [yes]:
 >

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions