From 70f831e4c04a3fddf9200707956b3ba7db62108d Mon Sep 17 00:00:00 2001 From: Serge Barinov Date: Sun, 5 Jun 2022 09:42:39 +0300 Subject: [PATCH 1/3] fix: escape user full name for mention Former-commit-id: 09e7597fa757c229fbe207683f42b0940dafa1c5 --- src/utils/markdown.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/markdown.rs b/src/utils/markdown.rs index 9b120d6ad..c07d53d94 100644 --- a/src/utils/markdown.rs +++ b/src/utils/markdown.rs @@ -124,7 +124,7 @@ pub fn escape_code(s: &str) -> String { pub fn user_mention_or_link(user: &User) -> String { match user.mention() { Some(mention) => mention, - None => link(user.url().as_str(), &user.full_name()), + None => link(user.url().as_str(), &escape(&user.full_name())), } } From eb351931b580cf7e67d63de4873c354835ab684b Mon Sep 17 00:00:00 2001 From: Serge Barinov Date: Sun, 5 Jun 2022 09:50:12 +0300 Subject: [PATCH 2/3] update CHANGELOG Former-commit-id: ff85bf5e66c3151f503c5f4b266ce60c40c8761a --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 821e928fb..525278993 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## unreleased +### Fixed + + - Fix Api Unknown error (Can't parse entities) on message created with `utils::markdown::user_mention_or_link` if user full name contaiins some escapable symbols eg '.' + ## 0.9.1 - 2022-05-27 ### Fixed From d0c89036ffa8764eb55afc0c2c909510629213e9 Mon Sep 17 00:00:00 2001 From: Hirrolot Date: Tue, 7 Jun 2022 10:06:37 +0600 Subject: [PATCH 3/3] Release v0.9.2 Former-commit-id: 3757d837a07af5d8d40498e5eb2273c85f83e319 --- CHANGELOG.md | 2 ++ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 525278993..5e5fa7404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## unreleased +## 0.9.2 - 2022-06-07 + ### Fixed - Fix Api Unknown error (Can't parse entities) on message created with `utils::markdown::user_mention_or_link` if user full name contaiins some escapable symbols eg '.' diff --git a/Cargo.toml b/Cargo.toml index f5f91e991..2fc06eb32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "teloxide" -version = "0.9.1" +version = "0.9.2" edition = "2021" description = "An elegant Telegram bots framework for Rust" repository = "https://github.com/teloxide/teloxide"