Skip to content

Commit 7a36e5a

Browse files
committed
Preprocess: remove dead loader link
This removes a loader link that is added by the startup script. The link is for jquery and MediaWiki scripts, which the offline version doesn't use.
1 parent b77f6bf commit 7a36e5a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

commands/preprocess.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,12 @@ def preprocess_css_file(fn):
355355
f = open(fn, "w", encoding='utf-8')
356356
f.write(text)
357357
f.close()
358+
359+
def preprocess_startup_script(fn):
360+
with open(fn, "r", encoding='utf-8') as f:
361+
text = f.read()
362+
363+
text = re.sub(r'document\.write\([^)]+\);', '', text)
364+
365+
with open(fn, "w", encoding='utf-8') as f:
366+
f.write(text)

preprocess.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,7 @@ def main():
6565
os.path.join(root, 'common/ext.css') ]:
6666
preprocess.preprocess_css_file(fn)
6767

68+
preprocess.preprocess_startup_script(os.path.join(root, 'common/startup_scripts.js'))
69+
6870
if __name__ == "__main__":
6971
main()

0 commit comments

Comments
 (0)