# -*- coding: utf-8 -*- import io, re, sys for f in sys.argv[1:]: c = io.open(f, encoding='utf-8').read() opens = c.count('') print('===', f.replace('\\', '/').split('/')[-1]) print(' oj-explains blocks:', c.count('class="oj-explains"')) print(' prob-detail panels:', c.count('class="prob-detail"')) print(' oj-sections:', c.count('data-oj-section=')) print(' CSS present:', '.prob-detail {' in c) print(' toggleProb:', 'function toggleProb' in c) print(' prob-sec-h count:', c.count('class="prob-sec-h"')) print(' div balance:', opens, '/', closes, 'OK' if opens == closes else 'MISMATCH') # sample first panel body m = re.search(r'
(.*?)
\s*\n', c, re.S) if m: blk = m.group(1) print(' sample has 题目:', '📋 题目' in blk, '| 孩子代码:', '👦 孩子的代码' in blk, '| 答案:', '✅ 参考答案' in blk, '| 解析:', '💡 解析' in blk)