增加评论互动趣味性
This commit is contained in:
1 parent
a93f46a2de
commit
9774eeac12
8 files changed
+181
-38
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import re
|
||||
|
||||
path = 'e:/GitHub/blog/public/js/bundle.min.6c8518518bf5af8d666e1b391ef3cf4caaaca7537fd1961891ed292d86eb3fed.js'
|
||||
with open(path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# Find all occurrences of initCodeFold
|
||||
idx = 0
|
||||
matches = []
|
||||
while True:
|
||||
idx = content.find('initCodeFold', idx)
|
||||
if idx == -1:
|
||||
break
|
||||
start = max(0, idx - 200)
|
||||
end = min(len(content), idx + 500)
|
||||
matches.append((idx, content[start:end]))
|
||||
idx += 1
|
||||
|
||||
print(f"Found {len(matches)} matches of 'initCodeFold'")
|
||||
print(f"File length: {len(content)} chars")
|
||||
print()
|
||||
|
||||
for i, (pos, context) in enumerate(matches):
|
||||
print(f'=== Match {i+1} at position {pos} ===')
|
||||
print(context)
|
||||
print()
|
||||
Reference in new issue
Block a user