mirror of
https://github.com/goccy/go-yaml.git
synced 2025-12-08 06:09:57 +00:00
Add indentation to flow values on new lines (#759)
This commit is contained in:
parent
0040ab4161
commit
07c09c0287
2 changed files with 61 additions and 2 deletions
|
|
@ -290,6 +290,30 @@ r: s
|
|||
- b
|
||||
- c - d - e
|
||||
- f
|
||||
`,
|
||||
},
|
||||
{
|
||||
`
|
||||
elem1:
|
||||
- elem2:
|
||||
{a: b, c: d}
|
||||
`,
|
||||
`
|
||||
elem1:
|
||||
- elem2:
|
||||
{a: b, c: d}
|
||||
`,
|
||||
},
|
||||
{
|
||||
`
|
||||
elem1:
|
||||
- elem2:
|
||||
[a, b, c, d]
|
||||
`,
|
||||
`
|
||||
elem1:
|
||||
- elem2:
|
||||
[a, b, c, d]
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
|
@ -1520,6 +1544,32 @@ foo2: &anchor text # anchor comment
|
|||
# foo3 comment
|
||||
# foo3 comment2
|
||||
foo3: *anchor # alias comment
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "flow map with inline key comment",
|
||||
yaml: `
|
||||
elem1:
|
||||
- elem2: # comment
|
||||
{a: b, c: d}
|
||||
`,
|
||||
expected: `
|
||||
elem1:
|
||||
- elem2: # comment
|
||||
{a: b, c: d}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "flow sequence with inline key comment",
|
||||
yaml: `
|
||||
elem1:
|
||||
- elem2: # comment
|
||||
[a, b, c, d]
|
||||
`,
|
||||
expected: `
|
||||
elem1:
|
||||
- elem2: # comment
|
||||
[a, b, c, d]
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue