YAML parser doesn't support double-newlines in folded style blocks
- Dominant language
- Go
- Stars
- 21.9k
- Forks
- 957
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 53
Description
[Folded style](https://yaml.org/spec/1.2-old/spec.html#style/block/folded) allows lines to be folded at a single space by turning the newline into a space, but a double newline is supposed to turn into a newline. The YAML parser used to parse `lima.yaml` does not implement this, but turns a double newline into 2 spaces:
```console
$ grep -A7 provision: ~/.lima/alpine/lima.yaml
provision:
- mode: system
script: >
#!/bin/bash
echo foo;
echo bar
$ limactl shell alpine sudo hexdump -C /mnt/lima-cidata/provision.system/00000000
00000000 23 21 2f 62 69 6e 2f 62 61 73 68 20 20 65 63 68 |#!/bin/bash ech|
00000010 6f 20 66 6f 6f 3b 20 20 65 63 68 6f 20 62 61 72 |o foo; echo bar|
00000020
```
The folded block above should be equivalent to this definition using [literal style](https://yaml.org/spec/1.2-old/spec.html#style/block/literal):
```yaml
provision:
- mode: system
script: |
#!/bin/bash
echo foo;
echo bar
```
You can verify this by pasting the YAML code into any online YAML validator, e.g. http://www.yamllint.com.
Contributor guide
Assessment
This issue has not been assessed yet.