Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RedCMD opened this issue Jun 2, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@RedCMD
Copy link

RedCMD commented Jun 2, 2024

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

@RedCMD RedCMD added the bug Something isn't working label Jun 2, 2024
@eemeli
Copy link
Owner

eemeli commented Jun 7, 2024

Yeah, there's something odd going on here. Probably to do with the -1 indent level that unindented nodes are considered to have.

@eemeli eemeli closed this as completed in 280a861 Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants