From 9a99be0607f5ec25c92e49d0df55ed1c36e4c330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Tue, 30 Jul 2024 02:05:32 +0200 Subject: [PATCH] Don't escape [ and ] --- discord_rss_bot/custom_message.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discord_rss_bot/custom_message.py b/discord_rss_bot/custom_message.py index 09dcd15..40414f9 100644 --- a/discord_rss_bot/custom_message.py +++ b/discord_rss_bot/custom_message.py @@ -71,8 +71,8 @@ def replace_tags_in_text_message(entry: Entry) -> str: first_image: str = get_first_image(summary, content) - summary = markdownify(summary, strip=["img", "table", "td", "tr", "tbody", "thead"]) - content = markdownify(content, strip=["img", "table", "td", "tr", "tbody", "thead"]) + summary = markdownify(html=summary, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) + content = markdownify(html=content, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) if "[https://" in content or "[https://www." in content: content = content.replace("[https://", "[") @@ -175,8 +175,8 @@ def replace_tags_in_embed(feed: Feed, entry: Entry) -> CustomEmbed: first_image: str = get_first_image(summary, content) - summary = markdownify(summary, strip=["img", "table", "td", "tr", "tbody", "thead"]) - content = markdownify(content, strip=["img", "table", "td", "tr", "tbody", "thead"]) + summary = markdownify(html=summary, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) + content = markdownify(html=content, strip=["img", "table", "td", "tr", "tbody", "thead"], escape_misc=False) if "[https://" in content or "[https://www." in content: content = content.replace("[https://", "[")