import os import re import sys sys.stdout.reconfigure(encoding='utf-8') with open('tools/test_extract.py', 'r', encoding='utf-8') as fp: code = fp.read() exec(code[:code.find("test_files = [")]) def build_html(filepath, html): title, meta_desc, content, pattern = extract_content(html) # パンくずの確認と補完 has_breadcrumbs = 'wiki-breadcrumbs' in content or 'wiki-breadcrumb' in content if not has_breadcrumbs: genre = "ダンジョン攻略" if "dungeons" in filepath else ("レイド攻略" if "raids" in filepath else "討滅戦攻略") clean_title = re.sub(r'【.*?】', '', title).replace('完全攻略', '').replace('攻略', '').strip() breadcrumb = f'
\n\n' content = breadcrumb + content else: # id="wiki-breadcrumb" を class="wiki-breadcrumbs" に統一 content = re.sub(r'