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

Spaces incorrectly striped from Javascript strings #45

Open
chrisspen opened this issue Aug 22, 2024 · 0 comments
Open

Spaces incorrectly striped from Javascript strings #45

chrisspen opened this issue Aug 22, 2024 · 0 comments

Comments

@chrisspen
Copy link

JSMin does not appear to correctly support interpolated Javascript strings, and as a result breaks Javascript by removing spaces from strings.

Steps to reproduce:

>>> import jsmin
>>> jsmin.jsmin("count_el.text(`${data['totalDocuments']} results for ${text}`);")
"count_el.text(`${data['totalDocuments']}results for ${text}`);"

Expected result:

"count_el.text(`${data['totalDocuments']} results for ${text}`);"

Notice it incorrectly removed the space after the "}" before "results".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant