diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 909d0cfe54ac..36aa9b0ace2f 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -323,18 +323,16 @@ private function getNextEmbedBlock($indentation = null) break; } - if ($removeComments && $this->isCurrentLineEmpty() || $this->isCurrentLineBlank()) { - if ($this->isCurrentLineBlank()) { - $data[] = substr($this->currentLine, $newIndent); - } + if ($this->isCurrentLineBlank()) { + $data[] = substr($this->currentLine, $newIndent); + continue; + } + if ($removeComments && $this->isCurrentLineComment()) { continue; } - if (preg_match('#^(?P *)$#', $this->currentLine, $match)) { - // empty line - $data[] = $match['text']; - } elseif ($indent >= $newIndent) { + if ($indent >= $newIndent) { $data[] = substr($this->currentLine, $newIndent); } elseif (0 == $indent) { $this->moveToPreviousLine();