fix(telegram): improve MarkdownV2 edit fallback and fix _strip_mdv2 bold handling
When edit_message(finalize=True) fails with a MarkdownV2 parse error, the silent fallback previously sent raw content with escape sequences. Now it logs the error and strips markdown formatting via _strip_mdv2() for clean plain-text fallback. Also fixes _strip_mdv2 to handle standard markdown bold (\*\*text\*\*) before MarkdownV2 bold (\*text\*), preventing half-stripped asterisks. Refs: #41955, #41732
This commit is contained in:
@@ -835,7 +835,7 @@ class TestEditMessageStreamingSafety:
|
||||
assert second_call == {
|
||||
"chat_id": 123,
|
||||
"message_id": 456,
|
||||
"text": "final **bold**",
|
||||
"text": "final bold",
|
||||
}
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user