File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff 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 )} " )
You can’t perform that action at this time.
0 commit comments