Josee9988 / MinifyAll

A 𝗩𝗦𝗖𝗼𝗱𝗲 𝗺𝗢𝗻𝗢𝗳𝗢𝗲𝗿 for JS, JSON/C, CSS, and HTML, you will love its simplicity! 🌟 π˜Ύπ™€π™’π™₯π™§π™šπ™¨π™¨ and π™œπ™―π™žπ™₯ files and folders πŸ“¦ Reduce your bundle and file sizes with lightning speed ⚑
https://minifyall.jgracia.es/
GNU General Public License v3.0
73 stars 13 forks source link

Minifying JSON is removing spaces inside the prop value #177

Open karamkhoury88 opened 1 year ago

karamkhoury88 commented 1 year ago

🐞 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

welcome[bot] commented 1 year ago

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!

Jacksoor commented 1 month ago

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 commented 1 month ago

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.