Description
When formatting YAML that uses a multiline block scalar as a map key, comments attached to the key are not preserved.
Reproduction
Input:
? | # comment
multi
line
key
: value
After yamlfmt:
? |
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.
Description
When formatting YAML that uses a multiline block scalar as a map key, comments attached to the key are not preserved.
Reproduction
Input:
After
yamlfmt: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.