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

Preserve inline comments on inline lists #443

Closed
saeedseyfi opened this issue Feb 20, 2023 · 2 comments
Closed

Preserve inline comments on inline lists #443

saeedseyfi opened this issue Feb 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@saeedseyfi
Copy link

saeedseyfi commented Feb 20, 2023

Describe the bug
Inline comments are removed from inline lists.

To Reproduce

const input = 'key1: [value1, value2] # comment';
const parsed = yaml.parseDocument(input);
const result = parsed.toString();

expect(result).toContain("# comment");

Expected behaviour
Comments should be preserved.

Versions:

  • Environment: Chrome Version 110.0.5481.100 (Official Build) (arm64)
  • yaml: 2.2.1

Additional context
Edit JS Playground (forked)

@saeedseyfi saeedseyfi added the bug Something isn't working label Feb 20, 2023
@eemeli eemeli closed this as completed in d4460a5 Feb 20, 2023
@eemeli
Copy link
Owner

eemeli commented Feb 20, 2023

Thank you for reporting that! Remarkably silly bug; the order of two string arguments was reversed when stringifying flow collections with comments.

@saeedseyfi
Copy link
Author

saeedseyfi commented Feb 21, 2023

Thank you @eemeli for the quick fix!

Any plans for publishing the patch?

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