Skip to content

Commit

Permalink
Added extra checks for comment & col item in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
wdiesveld authored and xabbuh committed May 4, 2020
1 parent 5308540 commit 3cdaadb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Symfony/Component/Yaml/Parser.php
Expand Up @@ -619,8 +619,14 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
}

$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
$isItComment = $this->isCurrentLineComment();

while ($this->moveToNextLine()) {
if ($isItComment && !$isItUnindentedCollection) {
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
$isItComment = $this->isCurrentLineComment();
}

$indent = $this->getCurrentLineIndentation();

if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) {
Expand Down

0 comments on commit 3cdaadb

Please sign in to comment.