@@ -169,7 +169,16 @@ private function doParse(string $value, int $flags)
169
169
}
170
170
171
171
// 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 ' ], ' ' ), '# ' )) {
173
182
$ data [] = $ this ->parseBlock ($ this ->getRealCurrentLineNb () + 1 , $ this ->getNextEmbedBlock (null , true ) ?? '' , $ flags );
174
183
} elseif (null !== $ subTag = $ this ->getLineTag (ltrim ($ values ['value ' ], ' ' ), $ flags )) {
175
184
$ data [] = new TaggedValue (
@@ -604,6 +613,7 @@ private function getNextEmbedBlock(int $indentation = null, bool $inSequence = f
604
613
}
605
614
606
615
$ data = [];
616
+
607
617
if ($ this ->getCurrentLineIndentation () >= $ newIndent ) {
608
618
$ data [] = substr ($ this ->currentLine , $ newIndent );
609
619
} elseif ($ this ->isCurrentLineEmpty () || $ this ->isCurrentLineComment ()) {
0 commit comments