Skip to content
Snippets Groups Projects
Commit 772765b0 authored by jan.bednarik's avatar jan.bednarik
Browse files

elections2021: Strip sup on program list page

parent f1fc569f
No related branches found
No related tags found
2 merge requests!277release,!276Volby
Pipeline #3776 passed
{% extends "elections2021/base.html" %}
{% load static wagtailcore_tags wagtailimages_tags wagtailroutablepage_tags %}
{% load static wagtailcore_tags wagtailimages_tags wagtailroutablepage_tags elections2021_extras %}
{% block content_header %}
......@@ -110,7 +110,7 @@
<div class="card icon-card shadow-none bg-grey-125 card--hoveractive" data-archetype="{% if show_archetype_icon %}{{ point.archetype }}{% endif %}">
<div class="card__body">
<h1 class="card-headline mb-8"><a href="{% pageurl point %}">{{ point.title }}</a></h1>
<div class="card-body-text">{{ point.annotation|richtext }}</div>
<div class="card-body-text"><a href="{% pageurl point %}">{{ point.annotation|richtext|strip_sup }}</a></div>
</div>
</div>
......
......@@ -57,3 +57,12 @@ def format_sources(value):
for sup in soup.find_all("sup"):
sup.wrap(soup.new_tag("a", id="reference", href="#zdroje"))
return str(soup)
@register.filter(is_safe=True)
@stringfilter
def strip_sup(value):
soup = bs4.BeautifulSoup(value, "html.parser")
for sup in soup.find_all("sup"):
sup.decompose()
return str(soup)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment