Skip to content

Extra blank line when serializing mapping inside of sequence #367

@bishabosha

Description

@bishabosha

when the serializer does "push and indent" for entering mapping/sequence, there is always a newline inserted see code, which leads to extra blank lines.

e.g. Map("foo" -> Seq(Map("bar" -> 123))).asYaml

Output

foo: 
  - 
    bar: 123

Expectation

foo: 
  - bar: 123

It would be nice to avoid the extra blank line specifically when the first entry of a sequence is a mapping. (it is fine for scalar values)

perhaps this could be configurable if there is a possibility of conflict

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions