Skip to content

CST.setScalarValue() does not preserve non-semantic indentation for block scalars #349

Open
@pjeby

Description

Describe the bug
CST.setScalarValue() does not preserve non-semantic indentation for block scalars

To Reproduce
Apply setScalarValue() to change the content of a 4-space indented block scalar value in an unindented map. The indentation will be reduced to 2 spaces if afterKey is set, zero otherwise.

Expected behaviour
The original indentation should be kept.

Versions (please complete the following information):

  • Environment: node 14.16 / electron 13.5.2 / chrome 91.0.4472.164
  • yaml: 2.0.0-10

Additional context
I'm not sure if this is technically a problem with setScalarValue, or with parsing not keeping track of the original indentation relative to the key.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions