Comment on multiline map key is moved to value
Open
yaml_v3_problem
- Dominant language
- Go
- Stars
- 1.8k
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
### Description
When formatting YAML that uses a **multiline block scalar as a map key**, comments attached to the key are not preserved.
---
### Reproduction
**Input:**
```yaml
? | # comment
multi
line
key
: value
```
**After `yamlfmt`:**
```yaml
? |
multi
line
key
: value # comment
```
The comment originally associated with the **multiline key (`? |`)** is moved to the value line.
---
### Expected behavior
The comment should remain attached to the multiline key, or the formatter should report that this construct is unsupported instead of silently moving the comment.
Contributor guide
Assessment
This issue has not been assessed yet.