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 committed May 4, 2020
1 parent 51acad8 commit 1e7eba0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Symfony/Component/Yaml/Parser.php
Expand Up @@ -618,8 +618,14 @@ private function getNextEmbedBlock(int $indentation = null, bool $inSequence = f
}

$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 1e7eba0

Please sign in to comment.