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)