remove the greater than symbol from the md sanitization method since it causes issues and does not seem to help w/ burnettk (#1685)

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
jasquat 2024-06-06 10:40:50 -04:00 committed by GitHub
parent 9150bb74b0
commit 10b30f6c14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -34,7 +34,10 @@ class JinjaHelpers:
def sanitize_for_md(cls, value: str) -> str:
"""Sanitizes given value for markdown."""
# modified from https://github.com/python-telegram-bot/python-telegram-bot/blob/1fdaaac8094c9d76c34c8c8e8c9add16080e75e7/telegram/utils/helpers.py#L149
escape_chars = r"_*[]()~`>#+-=|{}!"
#
# > was in this list but was removed because it doesn't seem to cause any
# issues and if it is in the list it prints like "&gt;" instead
escape_chars = r"_*[]()~`#+-=|{}!"
escaped_value = re.sub(f"([{re.escape(escape_chars)}])", r"\\\1", value)
escaped_value = escaped_value.replace("\n", "").replace("\r", "")
return escaped_value