1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-11-26 05:42:07 +00:00

minifier: dont strip whitespace inside string literals

This commit is contained in:
bleck9999 2021-08-02 21:25:36 +01:00
parent 6ad5c7b5f6
commit b678673d95
No known key found for this signature in database
GPG key ID: D0CA0C41DB616843

View file

@ -1,6 +1,6 @@
# Copyright (c) 2021 bleck9999
# https://github.com/bleck9999/ts-minifier
# Version: 700ce8d
# Version: a1e97807
import argparse
import itertools
@ -322,13 +322,13 @@ def whitespacent(script: str):
if part % 2 == 0:
if not line[part]:
break
mcode += line[part].replace('\t', '') + ' '
# turn lots of whitespace into one whitespace with one easy trick!
mcode += ' '.join(line[part].split()) + ' '
else:
mcode += f'"{line[part]}"'
part += 1
mcode = " ".join(mcode.split()) # turn lots of whitespace into one whitespace with one easy trick!
# tsv3 is still an absolute nightmare
# so spaces have a couple edge cases
# 1. the - operator which requires space between the right operand