Skip to content

Commit 00d28c6

Browse files
committed
Add some metadata
1 parent 91729ae commit 00d28c6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

changedetectionio/rss_tools.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def repl(m):
3232
# Jinja2 template for formatting RSS/Atom feed entries
3333
# Covers all common feedparser entry fields including namespaced elements
3434
# Outputs HTML that will be converted to text via html_to_text
35-
RSS_ENTRY_TEMPLATE = """
36-
{%- if entry.title -%}Title: {{ entry.title }}<br>{%- endif -%}
35+
# @todo - This could be a UI setting in the future
36+
RSS_ENTRY_TEMPLATE = """<article class="rss-item" id="{{ entry.id|replace('"', '')|replace(' ', '-') }}">{%- if entry.title -%}Title: {{ entry.title }}<br>{%- endif -%}
3737
{%- if entry.link -%}<strong>Link:</strong> <a href="{{ entry.link }}">{{ entry.link }}</a><br>
3838
{%- endif -%}
3939
{%- if entry.id -%}
@@ -143,8 +143,7 @@ def repl(m):
143143
<strong>Content:</strong> {{ entry.content[0].value | safe }}
144144
{%- elif entry.summary -%}
145145
<strong>Summary:</strong> {{ entry.summary | safe }}
146-
{%- endif -%}
147-
146+
{%- endif -%}</article>
148147
"""
149148

150149

@@ -197,7 +196,7 @@ def format_rss_items(rss_content: str, render_anchor_tag_content=False) -> str:
197196
class_str = ' '.join(classes)
198197
items_html.append(f'<div class="{class_str}">{item}</div>')
199198

200-
return '<html><body>\n' + "\n<br><br>".join(items_html) + '\n</body></html>'
199+
return '<html><body>\n' + "\n<br>".join(items_html) + '\n</body></html>'
201200

202201
except Exception as e:
203202
logger.warning(f"Error formatting RSS items: {str(e)}")

0 commit comments

Comments
 (0)