Skip to content

[Yaml] Excess whitespace around tagged scalars in inline arrays #25856

@z38

Description

@z38
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.0.3/master

I'm not sure whether I understand the YAML standard correctly, however it seems that entries of flow sequences can contain trailing whitespace.

At the moment the trailing whitespace is part of the tagged value:

use Symfony\Component\Yaml\Yaml;

$yaml = Yaml::parse('[ !foo bar ]', Yaml::PARSE_CUSTOM_TAGS);
var_dump($yaml[0]->getValue() === 'bar'); // returns false because value is 'bar '

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions