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

Space removed in JSON values #53

Open
drodiger opened this issue Jan 14, 2021 · 4 comments
Open

Space removed in JSON values #53

drodiger opened this issue Jan 14, 2021 · 4 comments
Assignees
Labels
Type: Bug Something isn't working as expected.

Comments

@drodiger
Copy link

🐞 Bug Report

Describe the bug

Version 2.4.13 on VS Code 1.52.1

On JSON which has string value, space in value is removed on minify.
Example
{
"headers": "Content-Type:application/json\nAccept: application/json",
"body": "{"login":{"username": "${username}","password": "${password}"}}"
}
Space in values are removed on Minify. Example, after Accept:, between username, between pasword...
This is after beautified, minified JSON. (problem is creted during minify operation
{
"headers": "Content-Type:application/json\nAccept:application/json",
"body": "{"login":{"username":"${username}","password":"${password}"}}"
}

Your environment

  • OS: Windows 10
    MinifyAll: 2.4.13
    VS Code: 1.52.1 user install
@Josee9988
Copy link
Owner

It should work as expected, right? I mean, the space removed is not making your code wrong. If this is a JSON, then the space after the ":" is useless.
Does the minified code give you any kind of problem compared to the non-minified one?

Thanks for posting out!

@drodiger
Copy link
Author

It should work as expected, right? I mean, the space removed is not making your code wrong. If this is a JSON, then the space after the ":" is useless.
Does the minified code give you any kind of problem compared to the non-minified one?

Thanks for posting out!

Data between " and " should not be changed in any way. This is a string value.
It didn't influence me for now, but there could be data, that need to preserve space.
{"key":"val ue"} this should not be translated into {"key":"value"}

@drodiger
Copy link
Author

BTW, I have JSON as string value. To have " inside string value, I have to use \ before ".
So: "{\"login\":{\"username\": \"${username}\",\"password\": \"${password}\"}}" Bold is value that should not be checked or minified in any way.

@Josee9988
Copy link
Owner

I will try to check it as soon as I have some free time. Thanks!

@Josee9988 Josee9988 transferred this issue from Josee9988/MinifyAll Feb 23, 2021
@Josee9988 Josee9988 added the Type: Bug Something isn't working as expected. label May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants