From 52c06e4cd474fce23db7623b653d6cbd49f2a6df Mon Sep 17 00:00:00 2001 From: JOUNGWOOK KWON Date: Mon, 30 Mar 2026 13:59:10 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AA=A9=EC=B0=A8(TOC)=EB=A5=BC=20h2?= =?UTF-8?q?=EA=B0=80=203=EA=B0=9C=20=EC=9D=B4=EC=83=81=EC=9D=BC=20?= =?UTF-8?q?=EB=95=8C=EB=A7=8C=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 짧은 글에서 '목차' 텍스트만 덩그러니 나오는 문제 수정. Co-Authored-By: Claude Opus 4.6 --- bots/publisher_bot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bots/publisher_bot.py b/bots/publisher_bot.py index d3f3193..f909a06 100644 --- a/bots/publisher_bot.py +++ b/bots/publisher_bot.py @@ -322,7 +322,9 @@ def build_full_html(article: dict, body_html: str, toc_html: str) -> str: ) html_parts.append(json_ld) - if toc_html: + # 목차는 h2가 3개 이상일 때만 표시 (짧은 글에선 불필요) + h2_count = body_html.lower().count('= 3: html_parts.append(f'
{toc_html}
') html_parts.append(body_html)