use urlize filter on comments to make links clickable #33

Merged
kparal merged 1 commit from feature/urlize into develop 2023-03-09 14:08:35 +00:00

View file

@ -94,12 +94,13 @@ Click on the <strong class="btn btn-success btn-xs">Enter result</strong> button
{% for bug in comment[0] %}
<a class="external" target="_blank" href="https://bugzilla.redhat.com/show_bug.cgi?id={{bug}}">#{{bug}}</a>,
{% endfor %}
{% if comment[1]|length > 200 %}
<span>{{comment[1][:200]}}</span>
<span class="collapse" id="c_{{category_index}}_{{line_index}}_{{loop.index}}">{{comment[1][200:]}}</span>
{% if comment[1] | length > 200 %}
{% set cut_index = comment[1] | truncate(length=200, end="", leeway=0) | length %}
<span>{{comment[1] | truncate(length=200, end="", leeway=0) | urlize(80, nofollow=true, target="_blank")}}</span>
<span class="collapse" id="c_{{category_index}}_{{line_index}}_{{loop.index}}">{{comment[1][cut_index:] | urlize(80, nofollow=true, target="_blank")}}</span>
<a data-toggle="collapse" class="collapse-toggle collapsed" href="#c_{{category_index}}_{{line_index}}_{{loop.index}}"></a>
{% else %}
{{comment[1]}}
{{comment[1]|urlize(80, nofollow=true, target="_blank")}}
{% endif %}
{% if comment[0] or comment[1] %}