-
-
Notifications
You must be signed in to change notification settings - Fork 725
Open
Description
Description
When yq processes a YAML file that contains a flow-style mapping entry followed by a multiline map key, the newline between them is not preserved.
As a result, the multiline key is concatenated onto the previous line, producing invalid YAML output.
Reproduction
Input file (test.yaml):
arr: [1, 2, 3]
? |
multi
line
key
: valueNote that:
arris written in flow style- the next mapping entry uses a multiline block scalar as a key
- there is a blank line separating them
Command
yq test.yamlActual Output
arr: [1, 2, 3]? |
multi
line
key
: valueThe newline between the flow-style entry (arr: [1, 2, 3]) and the multiline key is lost, causing the multiline key (? |) to be appended to the previous line.
Expected Output
The newline should be preserved:
arr: [1, 2, 3]
? |
multi
line
key
: value