diff --git a/discord_rss_bot/custom_message.py b/discord_rss_bot/custom_message.py
index 99a7e11..f6ff0f5 100644
--- a/discord_rss_bot/custom_message.py
+++ b/discord_rss_bot/custom_message.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import html
import json
import logging
from dataclasses import dataclass
@@ -68,6 +69,10 @@ def replace_tags_in_text_message(entry: Entry) -> str:
first_image: str = get_first_image(summary, content)
+ # Unescape HTML entities (e.g., <h1> becomes
) before converting to markdown
+ summary = html.unescape(summary)
+ content = html.unescape(content)
+
summary = markdownify(
html=summary,
strip=["img", "table", "td", "tr", "tbody", "thead"],
@@ -199,6 +204,10 @@ def replace_tags_in_embed(feed: Feed, entry: Entry) -> CustomEmbed:
first_image: str = get_first_image(summary, content)
+ # Unescape HTML entities (e.g., <h1> becomes ) before converting to markdown
+ summary = html.unescape(summary)
+ content = html.unescape(content)
+
summary = markdownify(
html=summary,
strip=["img", "table", "td", "tr", "tbody", "thead"],