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

This commit is contained in:
景大侠
2026-02-11 09:20:50 +08:00
parent 812c5873aa
commit 258171c9c4
+8 -4
View File
@@ -237,10 +237,14 @@ class Telegram:
return False return False
try: try:
if title and text: # 标准化标题后再加粗,避免**符号被显示为文本
caption = f"**{title}**\n{text}" bold_title = (
elif title: f"**{standardize(title).removesuffix('\n')}**" if title else None
caption = f"**{title}**" )
if bold_title and text:
caption = f"{bold_title}\n{text}"
elif bold_title:
caption = bold_title
elif text: elif text:
caption = text caption = text
else: else: