You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Thanks for creating this YAML parser. I have been working on using it in one of my projects and I have hit a weird scenario. It seems that in some cases, empty multi-line arrays are having their empty entry moved down a line and having its indentation space added on the line it was on. I am not sure if this YAML is considered correct under the YAML spec in use, so please let me know if the YAML is incorrect/out of spec.
To Reproduce
parseDocument then toString the following YAML:
FFF:
-
It seems to result in:
---
FFF:
-
---
This seems wrong to me, but maybe that is what the spec dictates should happen.
Expected behaviour
I expect the output to be as close to, if not the same as, the input as is possible:
FFF:
-
Versions (please complete the following information):
Environment: Node v18.0.0
yaml: 2.6.0
Additional context
I am not 100% sure on how nesting levels would affect this or if it would be fine to try to investigate the root cause of the issue. But I would be happy to take a stab at it if you are fine with that.
The text was updated successfully, but these errors were encountered:
Was able to replicate this; this is happening because a newline after a - sequence indicator is setting spaceBefore on the node, and when stringifying that's getting serialised before the - indicator.
Decided to fix this by ignoring newlines after the - for spaceBefore consideration.
Describe the bug
Thanks for creating this YAML parser. I have been working on using it in one of my projects and I have hit a weird scenario. It seems that in some cases, empty multi-line arrays are having their empty entry moved down a line and having its indentation space added on the line it was on. I am not sure if this YAML is considered correct under the YAML spec in use, so please let me know if the YAML is incorrect/out of spec.
To Reproduce
parseDocument
thentoString
the following YAML:FFF: -
It seems to result in:
--- FFF: - ---
This seems wrong to me, but maybe that is what the spec dictates should happen.
Expected behaviour
I expect the output to be as close to, if not the same as, the input as is possible:
FFF: -
Versions (please complete the following information):
yaml
: 2.6.0Additional context
I am not 100% sure on how nesting levels would affect this or if it would be fine to try to investigate the root cause of the issue. But I would be happy to take a stab at it if you are fine with that.
The text was updated successfully, but these errors were encountered: