[misc] fix tg-emoji closing tag: use constant (#1608)

* fix tg-emoji closing tag: use constant

* add changelog for tg-emoji closing tag fix

* Update CHANGES/1608.misc.rst

---------

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
This commit is contained in:
Suren Khorenyan 2024-11-25 23:08:05 +03:00 committed by GitHub
parent 141a550ab2
commit 6520b9fba2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

1
CHANGES/1608.misc.rst Normal file
View file

@ -0,0 +1 @@
Fixed closing tag for :code:`tg-emoji` in the :class:`aiogram.utils.text_decoration.HtmlDecoration`: use the same constant as for tag opening

View file

@ -218,7 +218,7 @@ class HtmlDecoration(TextDecoration):
return html.escape(value, quote=False)
def custom_emoji(self, value: str, custom_emoji_id: str) -> str:
return f'<{self.EMOJI_TAG} emoji-id="{custom_emoji_id}">{value}</tg-emoji>'
return f'<{self.EMOJI_TAG} emoji-id="{custom_emoji_id}">{value}</{self.EMOJI_TAG}>'
def blockquote(self, value: str) -> str:
return f"<{self.BLOCKQUOTE_TAG}>{value}</{self.BLOCKQUOTE_TAG}>"