mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fixed bug with wrong markdownv2 custom emoji parsing
This commit is contained in:
parent
b5d94f17b5
commit
5b339354a5
2 changed files with 2 additions and 2 deletions
|
|
@ -253,7 +253,7 @@ class MarkdownDecoration(TextDecoration):
|
|||
return re.sub(pattern=self.MARKDOWN_QUOTE_PATTERN, repl=r"\\\1", string=value)
|
||||
|
||||
def custom_emoji(self, value: str, custom_emoji_id: str) -> str:
|
||||
return self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}")
|
||||
return f'!{self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}")}'
|
||||
|
||||
def blockquote(self, value: str) -> str:
|
||||
return "\n".join(f">{line}" for line in value.splitlines())
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class TestTextDecoration:
|
|||
[
|
||||
markdown_decoration,
|
||||
MessageEntity(type="custom_emoji", offset=0, length=5, custom_emoji_id="42"),
|
||||
"[test](tg://emoji?id=42)",
|
||||
"",
|
||||
],
|
||||
[
|
||||
markdown_decoration,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue