google / google/yamlfmt

Folded block scalars with whitespace at the end causes problems

Open
#86 5 comments 10 reactions 0 assignees View on GitHub
yaml_v3_problem
Dominant language
Go
Stars
1.8k
Forks
75
PR merge metrics
No merged PRs in 30d

Description

While investigating #84 I realized that the yaml library parses weirdly when there is whitespace at the end of lines in a folded block scalar.

When `scan_folded_as_literal: false`, you get the original bug shown in issue #84.

When `scan_folded_as_literal: true`, you get the following with the same input:
```yaml
Foobar:
baz: "Lorem Ipsum is simply dummy text of the printing_and_typesetting industry.
\n#magic___^_^___line\n"
Foobaz:
baz: "foobar"
```

Will need to figure out why whitespace at the end of the line causes the library to think it's not printable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.