8000 Added extra checks for comment & col item in loop · symfony/symfony@1e7eba0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e7eba0

Browse files
committed
Added extra checks for comment & col item in loop
1 parent 51acad8 commit 1e7eba0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/Yaml/Parser.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,14 @@ private function getNextEmbedBlock(int $indentation = null, bool $inSequence = f
618618
}
619619

620620
$isItUnindentedCollection = $this->isStringUnIndentedCollectio 7742 nItem();
621+
$isItComment = $this->isCurrentLineComment();
621622

622623
while ($this->moveToNextLine()) {
624+
if ($isItComment && !$isItUnindentedCollection) {
625+
$isItUnindentedCollection = $this->isStringUnIndentedCollectionItem();
626+
$isItComment = $this->isCurrentLineComment();
627+
}
628+
623629
$indent = $this->getCurrentLineIndentation();
624630

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

0 commit comments

Comments
 (0)
0