-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Block Scalar indentation shenanigans #553
Comments
Your example is not at the root level. You've already started a mapping which puts the level from -1 to 0.
That scalar is present when there is no indentation yet, because no mapping or sequence is yet started. I think it was a mistake to have defined no indentation as indentation of -1. imho, non-key, scalar content should not be allowed in column 1 as lines like |
regarding
This looks like an oversight in the 1.2.1 -> 1.2.2 spec.
and https://yaml.org/spec/1.2.2/#rule-c-l+literal https://yaml.org/spec/1.2.2/#rule-l+block-sequence
As you can see, for rule 183 the indentation parameter was changed from |
that confirms my suspicion def: |
making this
invalid
---
|
and this is 0 indent
instead of -1 |
I've added a fix making the first variant properly an error, i.e. abc:
| #this should be an error
block scalar header requires +1 indentation The second variant I'm going to consider a spec bug, and not fix the current implementation. I think the current implementation follows the intent of the spec, even if the specific rule (probably
|
Describe the bug
I would think this is quite some oversight in the YAML spec
what are your thoughts on it?
To Reproduce
Expected behaviour
s-l+block-scalar requires that
|
must have +1 indentation from the parent node.I would think this is valid
c-l+literal doesn't add +1 onto the l-literal-content indentation
allowing the content to have 0 indentation inside a block collection
(and -1 indentation at root level)
I would think this shouldn't be allowed
l-chomped-empty doesn't actually allow tabs before the first trailing comment
I guess it kinda makes sense
Versions:
yaml
:2.4.3
Additional context
The text was updated successfully, but these errors were encountered: