Skip to content

Commit

Permalink
Rather than delete the <br>s make them spaces for #296
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Nov 6, 2023
1 parent 72fada2 commit 6d0bc18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends 'eke.knowledge/knowledge-object.html' %}
{% load knowledge_filters %}
{# 🔮 TODO: caching #}
{% block knowledge_description %}{% endblock %}
{% block knowledge_content %}
Expand Down Expand Up @@ -48,7 +49,7 @@
</dl>

<h2>Abstact</h2>
<p>{{page.description|safe|cut:"&#060;br&#062;"}}</p>
<p>{{page.description|safe|replace_brs}}</p>

<h2>Aims</h2>
<p>{{page.aims|safe}}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ def knowledge_value_joined(items: Orderable, separator=', ') -> str:
separating each.
'''
return separator.join([i.value for i in items.all()])


@register.filter
def replace_brs(value: str) -> str:
'''Certain protocols have abstracts with tons of <br>s in them. Change those to spaces.'''
return value.replace('&#060;br&#062;', ' ')

0 comments on commit 6d0bc18

Please sign in to comment.