Skip to content

Commit 9b593ee

Browse files
committed
Merge branch 'dead-link'
This fixes #12. * dead-link: Test: fix ignored test for remove_unused_external Preprocess: remove dead loader link
2 parents 243ad8a + ecb0167 commit 9b593ee

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
@@ -383,3 +383,12 @@ def preprocess_css_file(fn):
383383
f = open(fn, "w", encoding='utf-8')
384384
f.write(text)
385385
f.close()
386+
387+
def preprocess_startup_script(fn):
388+
with open(fn, "r", encoding='utf-8') as f:
389+
text = f.read()
390+
391+
text = re.sub(r'document\.write\([^)]+\);', '', text)
392+
393+
with open(fn, "w", encoding='utf-8') as f:
394+
f.write(text)

preprocess.py

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

69+
preprocess.preprocess_startup_script(os.path.join(root, 'common/startup_scripts.js'))
70+
6971
if __name__ == "__main__":
7072
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)