mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-25 16:12:06 +01:00
Merge pull request #641 from bool-rus/bugfix/escape_user_mention
fix: escape user full name for mention
Former-commit-id: e6d0123350
This commit is contained in:
commit
72949c2226
2 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## unreleased
|
## 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
|
## 0.9.1 - 2022-05-27
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -124,7 +124,7 @@ pub fn escape_code(s: &str) -> String {
|
||||||
pub fn user_mention_or_link(user: &User) -> String {
|
pub fn user_mention_or_link(user: &User) -> String {
|
||||||
match user.mention() {
|
match user.mention() {
|
||||||
Some(mention) => mention,
|
Some(mention) => mention,
|
||||||
None => link(user.url().as_str(), &user.full_name()),
|
None => link(user.url().as_str(), &escape(&user.full_name())),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue