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

New line removed after block comment #28

Open
squallco opened this issue Dec 4, 2020 · 0 comments
Open

New line removed after block comment #28

squallco opened this issue Dec 4, 2020 · 0 comments
Labels

Comments

@squallco
Copy link

squallco commented Dec 4, 2020

When parsing and stringifying back a JSON starting with a block comment and a new line, the new line is removed.
It doesn't happen with a JSON starting with an inline comment.

Tell us about your environment

  • Node Version: 15.3.0
  • comment-json Version 4.1.0

Please show your use case / code slices / code link that could reproduce the issue

const blockCommentJson = `/* Block comment. */
{}
`;
stringify(parse(blockCommentJson), null, 2);
/* Block comment. */{}

What did you expect to happen?

/* Block comment. */
{}

Example on StackBlitz

@squallco squallco added the bug label Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant