fix: Strip HTML tags from news description display

Use Jinja2 striptags filter to remove HTML from news.description
before displaying in ZOPK news cards. Prevents raw HTML like
<a href="..."> from showing as text.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-01-11 09:39:08 +01:00
parent e8f479ff2f
commit b21b3739d7
2 changed files with 4 additions and 2 deletions

View File

@ -442,7 +442,8 @@
<div class="news-content">
<h4>{{ news.title }}</h4>
{% if news.description %}
<p>{{ news.description[:200] }}{% if news.description|length > 200 %}...{% endif %}</p>
{% set clean_desc = news.description|striptags %}
<p>{{ clean_desc[:200] }}{% if clean_desc|length > 200 %}...{% endif %}</p>
{% endif %}
<div class="news-source">{{ news.source_name or news.source_domain }}</div>
</div>

View File

@ -188,7 +188,8 @@
<div class="news-content">
<h3>{{ news.title }}</h3>
{% if news.description %}
<p>{{ news.description[:250] }}{% if news.description|length > 250 %}...{% endif %}</p>
{% set clean_desc = news.description|striptags %}
<p>{{ clean_desc[:250] }}{% if clean_desc|length > 250 %}...{% endif %}</p>
{% endif %}
<div class="news-meta">
<span>{{ news.source_name or news.source_domain }}</span>