From 40eb216ee7cbbbbbe2f4ef9c03f11906e5463615 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EB=B0=95=EC=84=9C=EC=9D=80?=
<61147083+BangSun98@users.noreply.github.com>
Date: Thu, 19 Jun 2025 10:47:17 +0900
Subject: [PATCH] Update sns_content_service.py
---
smarketing-ai/services/sns_content_service.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/smarketing-ai/services/sns_content_service.py b/smarketing-ai/services/sns_content_service.py
index 8dd860c..db58e88 100644
--- a/smarketing-ai/services/sns_content_service.py
+++ b/smarketing-ai/services/sns_content_service.py
@@ -1936,6 +1936,14 @@ class SnsContentService:
# 이미지를 콘텐츠 맨 앞에 추가
content = images_html_content + content
+ # 🔥 핵심 수정: 인스타그램 본문에서 [IMAGE_X] 태그 모두 제거
+ import re
+ content = re.sub(r'\[IMAGE_\d+\]', '', content)
+
+ # 🔥 추가: 태그 제거 후 남은 빈 줄 정리
+ content = re.sub(r'\n\s*\n\s*\n', '\n\n', content) # 3개 이상의 연속 줄바꿈을 2개로
+ content = re.sub(r'
\s*
\s*
', '
', content) # 3개 이상의 연속
을 2개로
+
# 2. 네이버 블로그인 경우 이미지 태그를 실제 이미지로 변환
elif request.platform == '네이버 블로그' and image_placement_plan:
content = self._replace_image_tags_with_html(content, image_placement_plan, request.images)