Josee9988 / MinifyAllCli

πŸ“¦ A lightweight, simple and easy npm tool to π—Ίπ—Άπ—»π—Άπ—³π˜† JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as π‘ͺ𝑳𝑰 tool or π’Šπ’Žπ’‘π’π’“π’•π’‚π’ƒπ’π’† in TS/JS as a 𝑴𝑢𝑫𝑼𝑳𝑬 πŸ₯°
https://minifyall.jgracia.es/
BSD 3-Clause "New" or "Revised" License
25 stars 5 forks source link

Space removed in JSON values #53

Open drodiger opened 3 years ago

drodiger commented 3 years ago

🐞 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

Josee9988 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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