diff options
| author | levlam <levlam@telegram.org> | 2024-05-21 11:50:41 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2024-05-21 11:50:41 +0300 |
| commit | 36ebd42a92620b3b7e9b192f79a4dfd33c985e8b (patch) | |
| tree | f9ae3431f64b520c059ddc9f1fb86a27e236c117 /test/message_entities.cpp | |
| parent | 663eb78da587ddf36532e2667da33bc122f82ada (diff) | |
Allow attributes without value and support expandable blockquote entities in HTML parse_mode.
Diffstat (limited to 'test/message_entities.cpp')
| -rw-r--r-- | test/message_entities.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/message_entities.cpp b/test/message_entities.cpp index d0ee0a79d..22a48515c 100644 --- a/test/message_entities.cpp +++ b/test/message_entities.cpp @@ -1243,8 +1243,7 @@ TEST(MessageEntities, parse_html) { check_parse_html("🏟 🏟<<abac aba>", "Unsupported start tag \"abac\" at byte offset 13"); check_parse_html("🏟 🏟<<abac>", "Unsupported start tag \"abac\" at byte offset 13"); check_parse_html("🏟 🏟<<i =aba>", "Empty attribute name in the tag \"i\" at byte offset 13"); - check_parse_html("🏟 🏟<<i aba>", - "Expected equal sign in declaration of an attribute of the tag \"i\" at byte offset 13"); + check_parse_html("🏟 🏟<<i aba>", "Can't find end tag corresponding to start tag \"i\""); check_parse_html("🏟 🏟<<i aba = ", "Unclosed start tag \"i\" at byte offset 13"); check_parse_html("🏟 🏟<<i aba = 190azAz-.,", "Unexpected end of name token at byte offset 27"); check_parse_html("🏟 🏟<<i aba = \"<>">", "Unclosed start tag at byte offset 13"); @@ -1352,8 +1351,14 @@ TEST(MessageEntities, parse_html) { check_parse_html("🏟 🏟<b aba = caba><tg-emoji emoji-id=\"1\">🏟</tg-emoji>1</b>", "🏟 🏟🏟1", {{td::MessageEntity::Type::Bold, 5, 3}, {td::MessageEntity::Type::CustomEmoji, 5, 2, td::CustomEmojiId(static_cast<td::int64>(1))}}); - check_parse_html("<blockquote cite=\"\">a<<pre >b;</></>", "a<b;", + check_parse_html("<blockquote cite=\"\" askdlbas nasjdbaj nj12b3>a<<pre >b;</></>", "a<b;", {{td::MessageEntity::Type::BlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); + check_parse_html("<blockquote expandable>a<<pre >b;</></>", "a<b;", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); + check_parse_html("<blockquote expandable asd>a<<pre >b;</></>", "a<b;", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); + check_parse_html("<blockquote expandable=false>a<<pre >b;</></>", "a<b;", + {{td::MessageEntity::Type::ExpandableBlockQuote, 0, 4}, {td::MessageEntity::Type::Pre, 2, 2}}); } static void check_parse_markdown(td::string text, const td::string &result, |
