@@ -169,7 +169,16 @@ private function doParse(string $value, int $flags)
169169 }
170170
171171 // array
172- if (!isset ($ values ['value ' ]) || '' == trim ($ values ['value ' ], ' ' ) || 0 === strpos (ltrim ($ values ['value ' ], ' ' ), '# ' )) {
172+ if (isset ($ values ['value ' ]) && 0 === strpos (ltrim ($ values ['value ' ], ' ' ), '- ' )) {
173+ // Inline first child
174+ $ currentLineNumber = $ this ->getRealCurrentLineNb ();
175+
176+ $ sequenceIndentation = \strlen ($ values ['leadspaces ' ]) + 1 ;
177+ $ sequenceYaml = substr ($ this ->currentLine , $ sequenceIndentation );
178+ $ sequenceYaml .= "\n" .$ this ->getNextEmbedBlock ($ sequenceIndentation , true );
179+
180+ $ data [] = $ this ->parseBlock ($ currentLineNumber , rtrim ($ sequenceYaml ), $ flags );
181+ } elseif (!isset ($ values ['value ' ]) || '' == trim ($ values ['value ' ], ' ' ) || 0 === strpos (ltrim ($ values ['value ' ], ' ' ), '# ' )) {
173182 $ data [] = $ this ->parseBlock ($ this ->getRealCurrentLineNb () + 1 , $ this ->getNextEmbedBlock (null , true ) ?? '' , $ flags );
174183 } elseif (null !== $ subTag = $ this ->getLineTag (ltrim ($ values ['value ' ], ' ' ), $ flags )) {
175184 $ data [] = new TaggedValue (
@@ -604,6 +613,7 @@ private function getNextEmbedBlock(int $indentation = null, bool $inSequence = f
604613 }
605614
606615 $ data = [];
616+
607617 if ($ this ->getCurrentLineIndentation () >= $ newIndent ) {
608618 $ data [] = substr ($ this ->currentLine , $ newIndent );
609619 } elseif ($ this ->isCurrentLineEmpty () || $ this ->isCurrentLineComment ()) {
0 commit comments