allow markdown in message of the day

This commit is contained in:
vabene1111
2023-02-12 18:16:58 +01:00
parent 3c527fd112
commit 077db58de0
2 changed files with 4 additions and 2 deletions

View File

@@ -350,8 +350,8 @@
{% message_of_the_day request as message_of_the_day %}
{% if message_of_the_day %}
<div class="bg-success" style=" width: 100%; text-align: center!important; color: #ffffff; padding: 8px">
{{ message_of_the_day }}
<div class="bg-info" style=" width: 100%; text-align: center!important; color: #ffffff; padding: 8px">
{{ message_of_the_day | markdown |safe }}
</div>
{% endif %}

View File

@@ -57,6 +57,8 @@ def markdown(value):
]
)
markdown_attrs['*'] = markdown_attrs['*'] + ['class']
parsed_md = parsed_md[3:] # remove outer paragraph
parsed_md = parsed_md[:len(parsed_md)-4]
return bleach.clean(parsed_md, tags, markdown_attrs)