File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/Symfony/Component/Console Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class OutputFormatter implements OutputFormatterInterface
23
23
/**
24
24
* The pattern to phrase the format.
25
25
*/
26
- const FORMAT_PATTERN = '#( \\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>([^ \\\\<] *)#is ' ;
26
+ const FORMAT_PATTERN = '#( \\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?:(?! \\\\?<).) *)#is ' ;
27
27
28
28
private $ decorated ;
29
29
private $ styles = array ();
Original file line number Diff line number Diff line change 9
9
* file that was distributed with this source code.
10
10
*/
11
11
12
+
12
13
namespace Symfony \Component \Console \Tests \Formatter ;
13
14
14
15
use Symfony \Component \Console \Formatter \OutputFormatter ;
@@ -25,9 +26,15 @@ public function testEmptyTag()
25
26
public function testLGCharEscaping ()
26
27
{
27
28
$ formatter = new OutputFormatter (true );
29
+
28
30
$ this ->assertEquals ("foo<bar " , $ formatter ->format ('foo \\<bar ' ));
29
31
$ this ->assertEquals ("<info>some info</info> " , $ formatter ->format ('\\<info>some info \\</info> ' ));
30
32
$ this ->assertEquals ("\\<info>some info \\</info> " , OutputFormatter::escape ('<info>some info</info> ' ));
33
+
34
+ $ this ->assertEquals (
35
+ "\033[33mSymfony \\Component \\Console does work very well! \033[0m " ,
36
+ $ formatter ->format ('<comment>Symfony\Component\Console does work very well!</comment> ' )
37
+ );
31
38
}
32
39
33
40
public function testBundledStyles ()
You can’t perform that action at this time.
0 commit comments