From 4a40cf7695c64f0ef43ae695cb868ff461d4ffb7 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Fri, 29 Mar 2024 23:42:54 +0800 Subject: [PATCH] hack the Gemini markdown formst 2 --- handlers/gemini.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/gemini.py b/handlers/gemini.py index d985b3e..ee1891c 100644 --- a/handlers/gemini.py +++ b/handlers/gemini.py @@ -69,7 +69,7 @@ def gemini_handler(message: Message, bot: TeleBot) -> None: gemini_reply_text = player.last.text.strip() # Gemini is often using ':' in **Title** which not work in Telegram Markdown gemini_reply_text = gemini_reply_text.replace(":**", "\:**") - gemini_reply_text = gemini_reply_text.replace(":**", "**") + gemini_reply_text = gemini_reply_text.replace(":**", "**\: ") except StopCandidateException as e: match = re.search(r'content\s*{\s*parts\s*{\s*text:\s*"([^"]+)"', str(e)) if match: