Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbfe6f7

Browse files
committed
handle empty lines inside unindented collection
1 parentf1f5bff commitbbfe6f7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

‎src/Symfony/Component/Yaml/Parser.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false)
423423

424424
$previousLineIndentation =$indent;
425425

426-
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem() &&$newIndent ===$indent) {
426+
if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() &&$newIndent ===$indent) {
427427
$this->moveToPreviousLine();
428428
break;
429429
}

‎src/Symfony/Component/Yaml/Tests/ParserTest.php‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,22 @@ public function getBlockChompingTests()
189189
);
190190
$tests['Literal block chomping clip with multiple trailing newlines'] =array($expected,$yaml);
191191

192+
$yaml = <<<'EOF'
193+
foo:
194+
- bar: |
195+
one
196+
197+
two
198+
EOF;
199+
$expected =array(
200+
'foo' =>array(
201+
array(
202+
'bar' =>"one\n\ntwo",
203+
),
204+
),
205+
);
206+
$tests['Literal block chomping clip with embedded blank line inside unindented collection'] =array($expected,$yaml);
207+
192208
$yaml = <<<'EOF'
193209
foo: |
194210
one

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp