From b12c0840bcba0bd84f749e87fea52c4c6407e1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sun, 15 Jan 2023 06:10:53 +0100 Subject: [PATCH] Add content_raw and summary_raw --- discord_rss_bot/custom_message.py | 2 ++ discord_rss_bot/templates/custom.html | 6 ++++-- discord_rss_bot/templates/feed.html | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/discord_rss_bot/custom_message.py b/discord_rss_bot/custom_message.py index 1d657c0..fcd2934 100644 --- a/discord_rss_bot/custom_message.py +++ b/discord_rss_bot/custom_message.py @@ -65,6 +65,7 @@ def replace_tags(feed: Feed, entry: Entry) -> str: {"{{entry_added}}": entry.added}, {"{{entry_author}}": entry.author}, {"{{entry_content}}": content}, + {"{{entry_content_raw}}": entry.content[0]["value"]}, {"{{entry_id}}": entry.id}, {"{{entry_important}}": str(entry.important)}, {"{{entry_link}}": entry.link}, @@ -72,6 +73,7 @@ def replace_tags(feed: Feed, entry: Entry) -> str: {"{{entry_read}}": str(entry.read)}, {"{{entry_read_modified}}": entry.read_modified}, {"{{entry_summary}}": summary}, + {"{{entry_summary_raw}}": entry.summary}, {"{{entry_title}}": entry.title}, {"{{entry_updated}}": entry.updated}, ] diff --git a/discord_rss_bot/templates/custom.html b/discord_rss_bot/templates/custom.html index e88d5a8..be56ec2 100644 --- a/discord_rss_bot/templates/custom.html +++ b/discord_rss_bot/templates/custom.html @@ -28,14 +28,16 @@
  • {% raw %}{{entry_added}}{% endraw %} - {{entry.added}}
  • {% raw %}{{entry_author}}{% endraw %} - {{entry.author}}
  • -
  • {% raw %}{{entry_content}}{% endraw %} - {{entry.content[0].value}}
  • +
  • {% raw %}{{entry_content}}{% endraw %} - {{entry.content[0].value|discord_markdown}}
  • +
  • {% raw %}{{entry_content_raw}}{% endraw %} - {{entry.content[0].value}}
  • {% raw %}{{entry_id}}{% endraw %} - {{entry.id}}
  • {% raw %}{{entry_important}}{% endraw %} - {{entry.important}}
  • {% raw %}{{entry_link}}{% endraw %} - {{entry.link}}
  • {% raw %}{{entry_published}}{% endraw %} - {{entry.published}}
  • {% raw %}{{entry_read}}{% endraw %} - {{entry.read}}
  • {% raw %}{{entry_read_modified}}{% endraw %} - {{entry.read_modified}}
  • -
  • {% raw %}{{entry_summary}}{% endraw %} - {{entry.summary}}
  • +
  • {% raw %}{{entry_summary}}{% endraw %} - {{entry.summary|discord_markdown}}
  • +
  • {% raw %}{{entry_summary_raw}}{% endraw %} - {{entry.summary}}
  • {% raw %}{{entry_title}}{% endraw %} - {{entry.title}}
  • {% raw %}{{entry_updated}}{% endraw %} - {{entry.updated}}
  • diff --git a/discord_rss_bot/templates/feed.html b/discord_rss_bot/templates/feed.html index f2940b0..b3524cb 100644 --- a/discord_rss_bot/templates/feed.html +++ b/discord_rss_bot/templates/feed.html @@ -52,11 +52,11 @@ {% if entry.summary%}
    - {{ entry.summary | discord_markdown }} + {{ entry.summary|discord_markdown }}
    {% elif entry.content[0].value %}
    - {{ entry.content[0].value | discord_markdown }} + {{ entry.content[0].value|discord_markdown }}
    {% else %}