mirror of
https://github.com/won-ktds/smarketing-backend.git
synced 2025-12-06 07:06:24 +00:00
Update sns_content_service.py
This commit is contained in:
parent
67188a9e7a
commit
40eb216ee7
@ -1936,6 +1936,14 @@ class SnsContentService:
|
|||||||
# 이미지를 콘텐츠 맨 앞에 추가
|
# 이미지를 콘텐츠 맨 앞에 추가
|
||||||
content = images_html_content + content
|
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'<br>\s*<br>\s*<br>', '<br><br>', content) # 3개 이상의 연속 <br>을 2개로
|
||||||
|
|
||||||
# 2. 네이버 블로그인 경우 이미지 태그를 실제 이미지로 변환
|
# 2. 네이버 블로그인 경우 이미지 태그를 실제 이미지로 변환
|
||||||
elif request.platform == '네이버 블로그' and image_placement_plan:
|
elif request.platform == '네이버 블로그' and image_placement_plan:
|
||||||
content = self._replace_image_tags_with_html(content, image_placement_plan, request.images)
|
content = self._replace_image_tags_with_html(content, image_placement_plan, request.images)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user