Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK breaks dump #25842

Closed
@geek-merlin

Description

@geek-merlin
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2.8 (but should be same as current)

I stepped up to leverage Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK to make Drupal config dumps more diff-friendly.

Unfortunately special chars, especially "\r" are not round-tripping. Did not test other cars yet.
Tested with (drupals current) 3.2.8, but commit history does not indicate a relevant change since then.

A manual test:

$ drush ev 'print json_encode(\Symfony\Component\Yaml\Yaml::parse(\Symfony\Component\Yaml\Yaml::dump(["a\r\nb"]))) . "\n";'
["a\r\nb"]
$ drush ev 'print json_encode(\Symfony\Component\Yaml\Yaml::parse(\Symfony\Component\Yaml\Yaml::dump(["a\r\nb"],2,4, \Symfony\Component\Yaml\Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK))) . "\n";'
["a\nb\n"]

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