fix(telegram): 修复通知标题含特殊符号时异常显示**符号

This commit is contained in:
景大侠
2026-02-11 01:40:11 +08:00
parent 812c5873aa
commit 258171c9c4

View File

@@ -237,10 +237,14 @@ class Telegram:
return False
try:
if title and text:
caption = f"**{title}**\n{text}"
elif title:
caption = f"**{title}**"
# 标准化标题后再加粗,避免**符号被显示为文本
bold_title = (
f"**{standardize(title).removesuffix('\n')}**" if title else None
)
if bold_title and text:
caption = f"{bold_title}\n{text}"
elif bold_title:
caption = bold_title
elif text:
caption = text
else: