Skip to content

[Yaml] Multiline line return #18784

Closed
Closed
@theofidry

Description

@theofidry

If you have a YAML file with the following content:

username: |
    Bob

The parsed result will be:

[
  "username" => "Bob\n"
]

Which is expected. If you use instead:

username: |-
    Bob

The result will be:

[
  "username" => "Bob"
]

Up to that point, no problem. Now if I have:

User:
    foo:
        username: |
            Bob
    bar:
        username: |
            Bob
        group: ~

I would expect:

[
  "User" => [
    "foo" => [
      "username" => "Bob\n"
    ],
    "bar" => [
      "username" => "Bob\n",
      "group" => null,
    ],
  ]
]

But instead, of having "Bob\n" for "foo", I get "Bob" instead.

I'm not sure if it's the expected behaviour, but looks odd to me. Bug reproduced here. Tested on the the version v3.0.6.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions