Skip to content

Commit 9e2306e

Browse files
Perturbationicolas-grekas
authored andcommitted
[Console] Fixes "Incorrectly nested style tag found" error when using multi-line header content
1 parent ddfb4a8 commit 9e2306e

File tree

9 files changed

+46
-26
lines changed

9 files changed

+46
-26
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
----------------- ---------------------------------
99
Service ID .service_2
1010
Class Full\Qualified\Class2
11-
 Tags tag1 (attr1: val1, attr2: val2) 
12-
 tag1 (attr3: val3) 
13-
 tag2
11+
Tags tag1 (attr1: val1, attr2: val2)
12+
tag1 (attr3: val3)
13+
tag2
1414
Calls setMailer
1515
Public no
1616
Synthetic yes

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_2.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
----------------- ---------------------------------
44
Service ID -
55
Class Full\Qualified\Class2
6-
 Tags tag1 (attr1: val1, attr2: val2) 
7-
 tag1 (attr3: val3) 
8-
 tag2
6+
Tags tag1 (attr1: val1, attr2: val2)
7+
tag1 (attr3: val3)
8+
tag2
99
Calls setMailer
1010
Public no
1111
Synthetic yes

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
Autoconfigured no
1414
Factory Class Full\Qualified\FactoryClass
1515
Factory Method get
16-
 Arguments Service(.definition_2) 
17-
 %parameter% 
18-
 Inlined Service 
19-
 Array (3 element(s)) 
20-
 Iterator (2 element(s)) 
21-
 - Service(definition_1) 
22-
 - Service(.definition_2)
16+
Arguments Service(.definition_2)
17+
%parameter%
18+
Inlined Service
19+
Array (3 element(s))
20+
Iterator (2 element(s))
21+
- Service(definition_1)
22+
- Service(.definition_2)
2323
---------------- -----------------------------
2424

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_2.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
----------------- ---------------------------------
44
Service ID -
55
Class Full\Qualified\Class2
6-
 Tags tag1 (attr1: val1, attr2: val2) 
7-
 tag1 (attr3: val3) 
8-
 tag2
6+
Tags tag1 (attr1: val1, attr2: val2)
7+
tag1 (attr3: val3)
8+
tag2
99
Calls setMailer
1010
Public no
1111
Synthetic yes

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| Requirements | name: [a-z]+ |
1212
| Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub |
1313
| Defaults | name: Joseph |
14-
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15-
| | opt1: val1 |
16-
| | opt2: val2 |
14+
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15+
| | opt1: val1 |
16+
| | opt2: val2 |
1717
+--------------+-------------------------------------------------------------------+

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
| Requirements | NO CUSTOM |
1212
| Class | Symfony\Bundle\FrameworkBundle\Tests\Console\Descriptor\RouteStub |
1313
| Defaults | NONE |
14-
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15-
| | opt1: val1 |
16-
| | opt2: val2 |
14+
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
15+
| | opt1: val1 |
16+
| | opt2: val2 |
1717
| Condition | context.getMethod() in ['GET', 'HEAD', 'POST'] |
1818
+--------------+-------------------------------------------------------------------+

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"paragonie/sodium_compat": "^1.8",
3838
"symfony/asset": "^3.4|^4.0|^5.0",
3939
"symfony/browser-kit": "^4.3|^5.0",
40-
"symfony/console": "^4.4.21|^5.0",
40+
"symfony/console": "^4.4.42|^5.4.9",
4141
"symfony/css-selector": "^3.4|^4.0|^5.0",
4242
"symfony/dom-crawler": "^4.4.30|^5.3.7",
4343
"symfony/dotenv": "^4.3.6|^5.0",

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ private function buildTableRows(array $rows): TableRows
586586
}
587587
$escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell)));
588588
$cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped;
589-
$lines = explode("\n", str_replace("\n", "<fg=default;bg=default>\n</>", $cell));
589+
$lines = explode("\n", str_replace("\n", "<fg=default;bg=default></>\n", $cell));
590590
foreach ($lines as $lineKey => $line) {
591591
if ($colspan > 1) {
592592
$line = new TableCell($line, ['colspan' => $colspan]);

src/Symfony/Component/Console/Tests/Helper/TableTest.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ public function renderProvider()
615615
'default',
616616
<<<'TABLE'
617617
+-------+------------+
618-
[39;49m| [39;49m[37;41mDont break[39;49m[39;49m |[39;49m
619-
[39;49m| [39;49m[37;41mhere[39;49m |
618+
[37;41m| [39;49m[37;41mDont break[39;49m[37;41m |[39;49m
619+
[37;41m| here[39;49m |
620620
+-------+------------+
621621
| foo | Dont break |
622622
| bar | here |
@@ -1078,6 +1078,26 @@ public function renderSetTitle()
10781078
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
10791079
+---------------+--------- Page 1/2 -------+------------------+
10801080

1081+
TABLE
1082+
,
1083+
true,
1084+
],
1085+
'header contains multiple lines' => [
1086+
'Multiline'."\n".'header'."\n".'here',
1087+
'footer',
1088+
'default',
1089+
<<<'TABLE'
1090+
+---------------+--- Multiline
1091+
header
1092+
here +------------------+
1093+
| ISBN | Title | Author |
1094+
+---------------+--------------------------+------------------+
1095+
| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
1096+
| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
1097+
| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
1098+
| 80-902734-1-6 | And Then There Were None | Agatha Christie |
1099+
+---------------+---------- footer --------+------------------+
1100+
10811101
TABLE
10821102
],
10831103
[

0 commit comments

Comments
 (0)