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

Minifying JSON is removing spaces inside the prop value #177

Open
karamkhoury88 opened this issue Nov 17, 2023 · 3 comments
Open

Minifying JSON is removing spaces inside the prop value #177

karamkhoury88 opened this issue Nov 17, 2023 · 3 comments
Assignees
Labels
Type: Bug Something isn't working as expected.

Comments

@karamkhoury88
Copy link

karamkhoury88 commented Nov 17, 2023

🐞 Bug Report

Describe the bug

If the JSON text contains a property value containing a space followed by { e.g. ' {'
the minifying process removes this space
*


To Reproduce

  1. Let's have a JSON example of :
    {
    "Template": "Hello {{NAME}}"
    }

  2. Minify this JSON will produce the following result:
    {"Template":"Hello{{NAME}}"}

  3. The space before {{NAME}} is removed


Expected behaviour

the result must be:
{"Template":"Hello {{NAME}}"}

Your environment

  • OS: Windows 11

@karamkhoury88 karamkhoury88 added the Type: Bug Something isn't working as expected. label Nov 17, 2023
Copy link

welcome bot commented Nov 17, 2023

Thanks for opening your first issue in Josee9988/project-template! Be sure to follow the issue template and provide every bit of information to help the developers!

@karamkhoury88 karamkhoury88 changed the title Minifying JSON is removing the space inside the prop value Minifying JSON is removing spaces inside the prop value Nov 20, 2023
@Jacksoor
Copy link

The issue seems to be related to special JSON characters, for me it happens to the string "Text: Text". Seems the string boundaries are not respected for these kind character combinations.

@codemis
Copy link

codemis commented Oct 4, 2024

I am also noticing this issue. When the value is a string starting with a comma followed by space and a html tag, it removes the space. Also when I use a colon, it removes the space. Here is the JSON that I am testing:

before

This is the result:

after

I hope that helps.

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

4 participants