fix: Wikipedia 이미지 태그 전체 시도, TOC h2>=3 스마트 복원
- fetch_featured_image: 태그 전체(최대 8개) 시도, 제목 제외(너무 길어 매칭 안됨) px 크기 regex로 일괄 800px 교체 - TOC: h2>=3 조건부 표시 복원 (완전제거→스마트 표시) 두 파일(publisher_bot, blog_converter) 동일하게 적용 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -96,7 +96,10 @@ def build_full_html(article: dict, body_html: str, toc_html: str,
|
||||
json_ld = build_json_ld(article, post_url)
|
||||
disclaimer = article.get('disclaimer', '')
|
||||
parts = [json_ld]
|
||||
# 목차 비활성화 — 독자 경험 개선
|
||||
# 목차: h2가 3개 이상인 긴 글에서만 표시
|
||||
h2_count = body_html.lower().count('<h2')
|
||||
if toc_html and toc_html.strip() not in ('', '\n') and h2_count >= 3:
|
||||
parts.append(f'<div class="toc-wrapper">{toc_html}</div>')
|
||||
parts.append(body_html)
|
||||
if disclaimer:
|
||||
parts.append(f'<hr/><p class="disclaimer"><small>{disclaimer}</small></p>')
|
||||
|
||||
Reference in New Issue
Block a user