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:
parent
e8f479ff2f
commit
b21b3739d7
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user