diff --git a/infomate/settings.py b/infomate/settings.py index 61b99e2..81b20ed 100644 --- a/infomate/settings.py +++ b/infomate/settings.py @@ -15,6 +15,7 @@ ALLOWED_HOSTS = ["127.0.0.1", "0.0.0.0", "vas3k.ru", "infomate.club"] INSTALLED_APPS = [ "django.contrib.staticfiles", "django.contrib.humanize", + "django_bleach", "auth", "boards", "parsing" @@ -122,6 +123,8 @@ TELEGRAM_APP_HASH = None # should set in private_settings.py TELEGRAM_SESSION_FILE = None # should set in private settings.py TELEGRAM_CACHE_SECONDS = 10 * 60 # 10 min +BLEACH_STRIP_TAGS = True + try: # poor mans' private settings # As due to obvious reasons this file is missing in the repository, suppress the following 'pyflakes' error codes: diff --git a/requirements.txt b/requirements.txt index f8a493f..5cbc66b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,3 +12,4 @@ pyjwt>=1.7.1 nltk==3.4.5 newspaper3k>=0.2.8 telethon==1.10.10 +django-bleach==0.6.1 \ No newline at end of file diff --git a/templates/board.html b/templates/board.html index 3e602fa..3cf658c 100644 --- a/templates/board.html +++ b/templates/board.html @@ -1,6 +1,7 @@ {% extends "layout.html" %} {% load text_filters %} {% load static %} +{% load bleach_tags %} {% block title %}{{ board.curator_name }}{% if board.curator_title %} | {{ board.curator_title }}{% endif %} | {{ block.super }}{% endblock %} @@ -68,7 +69,7 @@
{% for article in articles %}
-
{{ article.icon|safe }}{{ article.title|striptags }}
+
{{ article.icon|safe }}{{ article.title|bleach }}
{% if article.image %} {{ article.title|striptags }}