增加评论互动趣味性
This commit is contained in:
1 parent
a93f46a2de
commit
9774eeac12
8 files changed
+181
-38
No files matched your search
@@ -0,0 +1,32 @@
|
||||
from pathlib import Path
|
||||
import glob
|
||||
|
||||
# Find latest bundle JS file
|
||||
js_files = sorted(Path('e:/GitHub/blog/public/js').glob('bundle.min.*.js'), key=lambda p: p.stat().st_mtime, reverse=True)
|
||||
if not js_files:
|
||||
print("No JS bundle found!")
|
||||
exit(1)
|
||||
|
||||
path = str(js_files[0])
|
||||
print(f"Checking: {path}")
|
||||
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
idx = content.find('window.initCodeFold=function')
|
||||
if idx == -1:
|
||||
print("NOT FOUND")
|
||||
else:
|
||||
chunk = content[idx:idx+800]
|
||||
print(chunk[:600])
|
||||
print()
|
||||
# Check for the key changes
|
||||
checks = [
|
||||
('parentNode.classList.contains("code-fold-container")', 'early return check'),
|
||||
('pre.scrollHeight', 'pre scrollHeight'),
|
||||
('block.scrollHeight', 'block fallback'),
|
||||
('contentHeight', 'contentHeight var'),
|
||||
]
|
||||
for pattern, desc in checks:
|
||||
found = pattern in chunk
|
||||
print(f" {desc}: {'YES' if found else 'MISSING!'}")
|
||||
Reference in new issue
Block a user