diff --git a/src/backend/html_markdown.py b/src/backend/html_markdown.py
index 95fa8959..583b8b13 100644
--- a/src/backend/html_markdown.py
+++ b/src/backend/html_markdown.py
@@ -10,6 +10,7 @@ from urllib.parse import unquote
import html_sanitizer.sanitizer as sanitizer
import lxml.html # nosec
+import emoji
import mistune
import nio
from html_sanitizer.sanitizer import Sanitizer
@@ -215,6 +216,12 @@ class HTMLProcessor:
if not outgoing:
self._matrix_to_links_add_classes(a_tag)
+ for node in tree.iterdescendants():
+ if node.tag != "code" and node.text:
+ node.text = emoji.emojize(node.text, language="alias")
+ if node.getparent() and node.getparent().tag != "code" and node.tail:
+ node.tail = emoji.emojize(node.tail, language="alias")
+
html = etree.tostring(tree, encoding="utf-8", method="html").decode()
html = sanit.sanitize(html).rstrip("\n")