From a248fc133beb3c2cead758aa66d0f3613418e695 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 24 Mar 2010 12:10:26 +0100 Subject: [PATCH] [Yaml] reverted previous commit --- src/Symfony/Components/Yaml/Parser.php | 7 +++-- .../Symfony/Components/Yaml/sfTests.yml | 28 ------------------- 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/Symfony/Components/Yaml/Parser.php b/src/Symfony/Components/Yaml/Parser.php index 4ae02e31a2..3873c6b4d3 100644 --- a/src/Symfony/Components/Yaml/Parser.php +++ b/src/Symfony/Components/Yaml/Parser.php @@ -300,9 +300,12 @@ class Parser while ($this->moveToNextLine()) { - if ($this->isCurrentLineBlank()) + if ($this->isCurrentLineEmpty()) { - $data[] = substr($this->currentLine, $newIndent); + if ($this->isCurrentLineBlank()) + { + $data[] = substr($this->currentLine, $newIndent); + } continue; } diff --git a/tests/fixtures/Symfony/Components/Yaml/sfTests.yml b/tests/fixtures/Symfony/Components/Yaml/sfTests.yml index 29c6100a9f..8eff31c60a 100644 --- a/tests/fixtures/Symfony/Components/Yaml/sfTests.yml +++ b/tests/fixtures/Symfony/Components/Yaml/sfTests.yml @@ -143,31 +143,3 @@ yaml: | 0123 php: | array('foo' => "0123\n") ---- -test: Comments in folded scalars -brief: Comments in folded scalars should be kept as is -yaml: | - # comment - foo: | - # comment - bar - bar: - # comment - foo: bar # comment - bar: | - # comment - foo - foobar: - foo: | - # comment - bar - # comment -php: | - array( - 'foo' => "# comment\nbar\n", - 'bar' => array( - 'foo' => 'bar', - 'bar' => "# comment\nfoo\n", - 'foobar' => array('foo' => "# comment\nbar\n") - ) - )