Skip to content

[BUG] Invalid MarkdownV1 parsing #3142

@why-not-try-calmer

Description

@why-not-try-calmer

Steps to Reproduce

  1. Call the mention_markdown(123, "Keeping_the_underscores", version=1) function from telegram.helpers

Expected behaviour

[Keeping_the_underscores](tg://user?id=123), that is valid MarkdownV1 and consistent with https://core.telegram.org/bots/api#markdown-style.

Actual behaviour

[Keeping\\_the\\_underscores](tg://user?id=123). However this will fail to parse into well-formed MarkdownV1 -- in fact Telegram will respond with an error if it occurs in a message with parse_mode = Markdown.

Operating System

Linux

Version of Python, python-telegram-bot & dependencies

python-telegram-bot==20.0a2

Relevant log output

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions