From 76bddb082420d04ff35f5d81a045cce1ae2108c4 Mon Sep 17 00:00:00 2001 From: JRoot Junior Date: Sat, 30 Dec 2023 19:22:06 +0200 Subject: [PATCH] Fixed text decorations --- aiogram/utils/text_decorations.py | 1 + tests/test_utils/test_text_decorations.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index f5590ded..5a8d28cc 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -56,6 +56,7 @@ class TextDecoration(ABC): MessageEntityType.UNDERLINE, MessageEntityType.STRIKETHROUGH, MessageEntityType.SPOILER, + MessageEntityType.BLOCKQUOTE, }: return cast(str, getattr(self, entity.type)(value=text)) if entity.type == MessageEntityType.PRE: diff --git a/tests/test_utils/test_text_decorations.py b/tests/test_utils/test_text_decorations.py index 25f222f0..e8ac11b5 100644 --- a/tests/test_utils/test_text_decorations.py +++ b/tests/test_utils/test_text_decorations.py @@ -66,6 +66,11 @@ class TestTextDecoration: MessageEntity(type="text_link", offset=0, length=5, url="https://aiogram.dev"), 'test', ], + [ + html_decoration, + MessageEntity(type="blockquote", offset=0, length=5), + "
test
", + ], [markdown_decoration, MessageEntity(type="bold", offset=0, length=5), "*test*"], [markdown_decoration, MessageEntity(type="italic", offset=0, length=5), "_\rtest_\r"], [markdown_decoration, MessageEntity(type="code", offset=0, length=5), "`test`"], @@ -106,6 +111,11 @@ class TestTextDecoration: ), "[test](tg://user?id=42)", ], + [ + markdown_decoration, + MessageEntity(type="blockquote", offset=0, length=5), + "> test", + ], ], ) def test_apply_single_entity(