| | @@ -780,15 +780,19 @@ |
| 780 | 780 | raise Http404("Ticket not found") |
| 781 | 781 | |
| 782 | 782 | body_html = mark_safe(sanitize_html(_render_fossil_content(ticket.body, project_slug=slug))) if ticket.body else "" |
| 783 | 783 | rendered_comments = [] |
| 784 | 784 | for c in comments: |
| 785 | + try: |
| 786 | + comment_html = mark_safe(sanitize_html(_render_fossil_content(c["comment"], project_slug=slug))) |
| 787 | + except Exception: |
| 788 | + comment_html = mark_safe(f"<pre>{c['comment']}</pre>") |
| 785 | 789 | rendered_comments.append( |
| 786 | 790 | { |
| 787 | 791 | "user": c["user"], |
| 788 | 792 | "timestamp": c["timestamp"], |
| 789 | | - "html": mark_safe(sanitize_html(_render_fossil_content(c["comment"], project_slug=slug))), |
| 793 | + "html": comment_html, |
| 790 | 794 | } |
| 791 | 795 | ) |
| 792 | 796 | |
| 793 | 797 | return render( |
| 794 | 798 | request, |
| 795 | 799 | |