yaml-rust icon indicating copy to clipboard operation
yaml-rust copied to clipboard

Emit multi-line string values as block scalars

Open ramosbugs opened this issue 6 years ago • 0 comments

This PR changes the output behavior to emit multi-line string values as block scalars instead of inline string literals with newline characters escaped, with the aim of improving the human readability of the emitted YAML.

For example, ["foo\nbar\nbaz"] is now emitted as:

- |-2
  foo
  bar
  baz

To properly handle trailing newlines, this PR also adds a trailing ... document marker following the dump output.

ramosbugs avatar Aug 30 '19 18:08 ramosbugs