File tree 2 files changed +29
-1
lines changed
src/Symfony/Component/Yaml
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -725,7 +725,7 @@ private function isNextLineUnIndentedCollection()
725
725
*/
726
726
private function isStringUnIndentedCollectionItem ()
727
727
{
728
- return 0 === strpos ($ this ->currentLine , '- ' );
728
+ return ' - ' === rtrim ( $ this -> currentLine ) || 0 === strpos ($ this ->currentLine , '- ' );
729
729
}
730
730
731
731
/**
Original file line number Diff line number Diff line change @@ -557,6 +557,34 @@ public function testSequenceInAMapping()
557
557
);
558
558
}
559
559
560
+ public function testSequenceInMappingStartedBySingleDashLine ()
561
+ {
562
+ $ yaml = <<<EOT
563
+ a:
564
+ -
565
+ b:
566
+ -
567
+ bar: baz
568
+ - foo
569
+ d: e
570
+ EOT ;
571
+ $ expected = array (
572
+ 'a ' => array (
573
+ array (
574
+ 'b ' => array (
575
+ array (
576
+ 'bar ' => 'baz ' ,
577
+ ),
578
+ ),
579
+ ),
580
+ 'foo ' ,
581
+ ),
582
+ 'd ' => 'e ' ,
583
+ );
584
+
585
+ $ this ->assertSame ($ expected , $ this ->parser ->parse ($ yaml ));
586
+ }
587
+
560
588
/**
561
589
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
562
590
*/
You can’t perform that action at this time.
0 commit comments