Skip to content

Commit 4d8d10c

Browse files
authored
Merge pull request p12tic#72 from PeterFeicht/dead-link
Remove dead loader link
2 parents 910175c + ecb0167 commit 4d8d10c

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
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()

tests/test_preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def test_remove_fileinfo(self):
260260
remove_fileinfo(self.html)
261261
self.check_output("fabs_fileinfo.html")
262262

263-
def remove_unused_external(self):
263+
def test_remove_unused_external(self):
264264
remove_unused_external(self.html)
265265
self.check_output("fabs_external.html")
266266

0 commit comments

Comments
 (0)