Closed
Description
Adding the following test in src/Symfony/Component/Yaml/Tests/ParserTest.php
would fail:
2.3...ogizanagi:yaml/ignored_comments
public function testSecondLevelFoldedStringBlockWithComments()
{
$this->assertEquals(array(
'pages' => array(
array(
'title' => 'some title',
'content' => <<<EOT
# comment 1
header
# comment 2
<body>
<h1>title</h1>
</body>
footer # comment3
EOT
),
),
), Yaml::parse(<<<EOF
pages:
-
title: some title
content: |
# comment 1
header
# comment 2
<body>
<h1>title</h1>
</body>
footer # comment3
EOF
));
}
There was 1 failure:
1) Symfony\Component\Yaml\Tests\ParserTest::testSecondLevelFoldedStringBlockWithComments
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
'pages' => Array (
0 => Array (
'title' => 'some title'
- 'content' => '# comment 1
- header
+ 'content' => 'header
- # comment 2
<body>
<h1>title</h1>
</body>
footer # comment3'
)
)
)
Such situations should already have been solved by #8472 and #8841.
Sadly, it's seems not to be sufficient when dealing with keys at a deeper level. :/