修复: Bot回复保留Markdown格式(标题和列表)
- 移除_clean_markdown()调用,改为仅清理<br>标签 - 保留标题(##)和列表短杠(-)等格式 - 关联Task #1740
This commit is contained in:
+2
-4
@@ -697,7 +697,8 @@ class AutoReply:
|
||||
if not answer:
|
||||
return None
|
||||
|
||||
# 清理 HTML 换行标签(纯文本消息里 <br> 会原形显示)
|
||||
# ⭐ Task #1740: 保留 Markdown 格式(标题、列表短杠)
|
||||
# 只清理影响显示的 HTML 换行标签,不破坏结构
|
||||
import re
|
||||
answer = re.sub(r'</?br\s*/?>', '\n', answer, flags=re.IGNORECASE)
|
||||
answer = answer.strip()
|
||||
@@ -711,9 +712,6 @@ class AutoReply:
|
||||
_keep_links = _is_download_intent and _has_url
|
||||
if _keep_links:
|
||||
logger.debug(f"[{platform}] 下载意图,保留链接格式")
|
||||
|
||||
# 清理 Markdown 格式,返回纯文本(下载类保留链接)
|
||||
answer = self._clean_markdown(answer, keep_links=_keep_links)
|
||||
if not answer:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user