Skip to content

Commit bdb3f5c

Browse files
committed
minor #7745 [Console] Add a note about escaping format tags (julienfalque, javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- [Console] Add a note about escaping format tags Commits ------- a798c0e Minor reword 3e65874 Add a note about escaping console format tags
2 parents 56de623 + a798c0e commit bdb3f5c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

console/coloring.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ You can also set these colors and options directly inside the tagname::
6565
// bold text on a yellow background
6666
$output->writeln('<bg=yellow;options=bold>foo</>');
6767

68+
.. note::
69+
70+
If you need to render a tag literally, escape it with a backslash: ``\<info>``
71+
or use the :method:`Symfony\\Component\\Console\\Formatter\\OutputFormatter::escape`
72+
method to escape all the tags included in the given string.
73+
6874
.. _Cmder: http://cmder.net/
6975
.. _ConEmu: https://conemu.github.io/
7076
.. _ANSICON: https://github.com/adoxa/ansicon/releases

0 commit comments

Comments
 (0)