mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
comments in minifier
This commit is contained in:
parent
f83eecf2e2
commit
b025958173
@ -39,7 +39,8 @@ def minify(path: str):
|
||||
# '\' allows for multiline strings, which would require reverting to processing syntax line by line to support them
|
||||
raise Exception(f"no escaping newlines! (offending file: {path})")
|
||||
|
||||
# drop the comments
|
||||
# drop the comments, unless the line has quotes, because quotes are scary
|
||||
# (quotes are scary since we could actually be inside a string: "-- ..." shouldn't get deleted)
|
||||
# -> whitespace before '--' and anything after that, which includes '---' comments
|
||||
minified = re.sub(r'\s*--+(?!.*[\'"]).*', '', contents)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user