usethesource: Linkify URLs in description and comments, retain line breaks

This commit is contained in:
Ben Sturmfels 2024-02-01 10:34:53 +11:00
parent 6c652f10c6
commit dddf6058a9
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@
</div>
</div>
{{ candidate.description|linebreaks }}
{{ candidate.description|urlize|linebreaksbr }}
{% with comments=candidate.comment_set.all %}
{% if comments or user.is_staff %}<h3 class="f3 lh-title mt4">Comments</h3>{% endif %}

View file

@ -3,5 +3,5 @@
<a href="#" class="f7 white bg-light-silver ph2" hx-get="{% url 'usethesource:edit_comment' comment_id=comment.id %}">edit</a>
<a href="#" class="f7 white bg-light-red ph2" hx-delete="{% url 'usethesource:delete_comment' comment_id=comment.id show_add='false' %}" hx-confirm="Are you sure you want to delete this comment?">delete</a>
{% endif %}
<br>{{ comment.message|linebreaks }}
<br>{{ comment.message|urlize|linebreaksbr }}
</div>