changeset 363:cddac8502c4b

chat/message: fix urlize escaping on nunjucks: Nunjucks imply to use `safe` when using `urlize`, while Jinja2 doesn't. Esacaping and safe filter are added so that `urlize` can work with both engines.
author Goffi <goffi@goffi.org>
date Wed, 28 Jun 2023 10:40:53 +0200
parents b2b859a62e70
children 095bd5b34080
files sat_templates/templates/bulma/chat/message.html
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat_templates/templates/bulma/chat/message.html	Wed Jun 28 10:40:50 2023 +0200
+++ b/sat_templates/templates/bulma/chat/message.html	Wed Jun 28 10:40:53 2023 +0200
@@ -37,7 +37,7 @@
                 </nav>
             {% endif -%}
             <p class="msg_body has-whitespace-pre-wrap" id="msg_body_{{msg.id}}" style="margin: 0;">
-            {{- msg.html or (msg.text|urlize) -}}
+            {{- msg.html or (msg.text|e|urlize|safe) -}}
             </p>
             <div id="actions_{{msg.id}}" class="level is-mobile actions mb-0">
                 <div class="level-right">