Optimize markdown format display

This commit is contained in:
6vision
2024-10-21 10:23:39 +08:00
parent 0773174a20
commit 9cc4d0ee07
4 changed files with 14 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import io
import os
import re
from urllib.parse import urlparse
from PIL import Image
from common.log import logger
@@ -68,3 +69,9 @@ def convert_webp_to_png(webp_image):
except Exception as e:
logger.error(f"Failed to convert WEBP to PNG: {e}")
raise
def remove_markdown_symbol(text: str):
# 移除markdown格式目前先移除**
if not text:
return text
return re.sub(r'\*\*(.*?)\*\*', r'\1', text)