-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
With CST parser newline is ignored/skipped after comment #525
Labels
bug
Something isn't working
Comments
Yup, confirming that's a bug. This looks like the minimal case for triggering this: let src = 'a:\n#\n- b'
let [doc] = Array.from(new YAML.Parser().parse(src))
YAML.CST.stringify(doc)
// 'a:\n#- b' |
The newline was getting dropped because the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Newline which should exist after comment is not serialized and start of array element is serialized directly after comment. This bug does not occur when there is indent before array element.
- name: a #Comment a 3
instead of- name: a #Comment a 3
.Input:
Output:
JSON dump of services map key where it can be seen that last element of
sep
is not newline.Expected behaviour
Should keep exact same output.
Versions (please complete the following information):
yaml
: 2.3.4Additional context
Method used to load:
Method to save
The text was updated successfully, but these errors were encountered: