Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console] SymfonyQuestionHelper escapes formatting in question prompts #20964

Copy link
Copy link
Closed
@polothy

Description

@polothy
Issue body actions
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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.