mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 07:38:21 +00:00
When including source at the top, make it more intelligible.
Avoid breaking URLs in particular.
This commit is contained in:
parent
e0fa1678a7
commit
dd6a65bb03
1 changed files with 4 additions and 1 deletions
5
main.py
5
main.py
|
@ -148,7 +148,10 @@ def ScriptHeader(script, avname):
|
|||
if avname:
|
||||
avname = ' - ' + avname
|
||||
return ('//start_unprocessed_text\n/*'
|
||||
+ re.sub(r'([*/])(?=[*|/])', r'\1|', script)
|
||||
# + re.sub(r'([*/])(?=[*|/])', r'\1|', script) # FS's algorithm
|
||||
# HACK: This won't break strings containing ** or /* or // like URLs,
|
||||
# while still being compatible with FS.
|
||||
+ re.sub(r'([*/]\||\*(?=/))', r'\1|', script)
|
||||
+ '*/\n//end_unprocessed_text\n//nfo_preprocessor_version 0\n'
|
||||
'//program_version LSL PyOptimizer v' + VERSION + avname
|
||||
+ '\n//mono\n\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue