Skip to content

Commit 50eadbd

Browse files
Merge branch '3.1' into 3.2
* 3.1: [appveyor] Update phpunit-bridge cache-id handle empty lines inside unindented collection
2 parents 85466ff + df9f281 commit 50eadbd

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Parser.php

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

463463
$previousLineIndentation = $indent;
464464

465-
if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) {
465+
if ($isItUnindentedCollection && !$this->isCurrentLineEmpty() && !$this->isStringUnIndentedCollectionItem() && $newIndent === $indent) {
466466
$this->moveToPreviousLine();
467467
break;
468468
}

Tests/ParserTest.php

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

213+
$yaml = <<<'EOF'
214+
foo:
215+
- bar: |
216+
one
217+
218+
two
219+
EOF;
220+
$expected = array(
221+
'foo' => array(
222+
array(
223+
'bar' => "one\n\ntwo",
224+
),
225+
),
226+
);
227+
$tests['Literal block chomping clip with embedded blank line inside unindented collection'] = array($expected, $yaml);
228+
213229
$yaml = <<<'EOF'
214230
foo: |
215231
one

0 commit comments

Comments
 (0)