From 3c83e72c493b520addbea58dec1c6416718dc242 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 25 Dec 2019 01:57:33 +0300 Subject: [PATCH] Add '-' to the list of reserved characters. GitOrigin-RevId: 97a77a46d7003e53021198bd1b57894df4fa5108 --- td/telegram/MessageEntity.cpp | 2 +- test/message_entities.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/td/telegram/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index 953768c7..b58cf862 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -1471,7 +1471,7 @@ static Result> do_parse_markdown_v2(CSlice text, string &r continue; } - Slice reserved_characters("_*[]()~`>#+=|{}.!"); + Slice reserved_characters("_*[]()~`>#+-=|{}.!"); if (!nested_entities.empty()) { switch (nested_entities.back().type) { case MessageEntity::Type::Code: diff --git a/test/message_entities.cpp b/test/message_entities.cpp index 780643bf..be3ac1a3 100644 --- a/test/message_entities.cpp +++ b/test/message_entities.cpp @@ -872,7 +872,7 @@ static void check_parse_markdown(td::string text, td::Slice error_message) { } TEST(MessageEntities, parse_markdown) { - td::Slice reserved_characters("]()>#+=|{}.!"); + td::Slice reserved_characters("]()>#+-=|{}.!"); td::Slice begin_characters("_*[~`"); for (char c = 1; c < 126; c++) { if (begin_characters.find(c) != td::Slice::npos) {