Skip to content

#comment parsed as incorrectly indented string in root block-scalar #547

@RedCMD

Description

@RedCMD

Describe the bug
An error occurs when a #comment is one outdented than the (root level) block-scalar indentation-indicator indicates
Block scalar lines must not be less indented than their explicit indentation indicator

To Reproduce

abc: |5 # no error
      # string 6
     # string 5
    #comment 4
   #comment 3

---

|5 # error at #comment 4
      # string 6
     # string 5
    #comment 4
   #comment 3

Expected behaviour
#comment 4 should be parsed as comment, not as part of the multi-line string

Versions:

  • Environment: VSCode 1.89
  • yaml: 2.4.2

Additional context
image
image

Metadata

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