From d8c6214170a87cb46048f18623e6bbb96dc1b37c Mon Sep 17 00:00:00 2001 From: Daniil Kovalenko <40635760+WhiteMemory99@users.noreply.github.com> Date: Sun, 30 Aug 2020 05:06:48 +0700 Subject: [PATCH] Fix HTML characters escaping (#409) html.escape replaces " and ' characters by default, but it's not required by Telegram and causes unexpected behavior, quote=False argument fixes that. --- aiogram/utils/text_decorations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index 3d22f637..4b3109af 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -159,7 +159,7 @@ class HtmlDecoration(TextDecoration): return f"{value}" def quote(self, value: str) -> str: - return html.escape(value) + return html.escape(value, quote=False) class MarkdownDecoration(TextDecoration):