Skip to content

Add option for deserialising multiline strings with indentation #585

@funnyboy-roks

Description

@funnyboy-roks

When deserialising a multiline string, an indentation of the lines is added to the string, so if a user doesn't want them to be indented, the lines must be pushed to the left edge.

This causes strings to be fairly hard to read when the field is nested:

(
    foo: (
         bar: "this
is
a
multiline
string"
    )
)

I propose that an option be added to the deserialiser that will support the following:

(
    foo: (
        bar: "this
              is
              a
              multiline
              string"
    )
)

(I think using an option is best so as to not break existing files)

I think the simplest method to do this would be to use the same logic as unindent (or even the crate itself)

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