From 377119810021a22a1ec54473bb37e655f3ade403 Mon Sep 17 00:00:00 2001 From: Lukas Brabec Date: Mar 09 2023 14:03:20 +0000 Subject: use urlize filter on comments --- diff --git a/testdays/templates/show_event.html b/testdays/templates/show_event.html index 988d748..796092a 100644 --- a/testdays/templates/show_event.html +++ b/testdays/templates/show_event.html @@ -94,12 +94,13 @@ Click on the Enter result button {% for bug in comment[0] %} #{{bug}}, {% endfor %} - {% if comment[1]|length > 200 %} - {{comment[1][:200]}} - {{comment[1][200:]}} + {% if comment[1] | length > 200 %} + {% set cut_index = comment[1] | truncate(length=200, end="", leeway=0) | length %} + {{comment[1] | truncate(length=200, end="", leeway=0) | urlize(80, nofollow=true, target="_blank")}} + {{comment[1][cut_index:] | urlize(80, nofollow=true, target="_blank")}} {% else %} - {{comment[1]}} + {{comment[1]|urlize(80, nofollow=true, target="_blank")}} {% endif %} {% if comment[0] or comment[1] %}