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

Values with either {} or [] add extra new line before value. #85

Closed
dmarchin opened this issue Feb 8, 2019 · 1 comment
Closed

Values with either {} or [] add extra new line before value. #85

dmarchin opened this issue Feb 8, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@dmarchin
Copy link

dmarchin commented Feb 8, 2019

When parsing documents that include values with either [] or {}, the resulting string representation adds a new line before the value.

Example:


const yamlString = `
testArray: []
testObject: {}
testArray2: ["hello"]
`;

const doc = YAML.parseDocument(yamlString);

console.log(doc.toString());

Result:

// result
testArray:
  []
testObject:
  {}
testArray2:
  [ "hello" ]

Expected:

// result
testArray: []
testObject: {}
testArray2: [ "hello" ]
@eemeli eemeli added the bug Something isn't working label Feb 8, 2019
@eemeli eemeli closed this as completed in b9c767f Feb 8, 2019
@eemeli
Copy link
Owner

eemeli commented Feb 8, 2019

Thanks for pointing this out. Collection pairs with single-line flow collections should now also get stringified as single lines.

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