Skip to content

Commit

Permalink
Output of ansi2html must be marked safe; DMOJ/judge-server#478
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyene committed Sep 29, 2019
1 parent e5297dd commit 0184aa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion judge/jinja2/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from ansi2html import Ansi2HTMLConverter
from django.contrib.auth.models import AbstractUser
from django.urls import reverse
from django.utils.safestring import mark_safe
from lxml.html import Element

from judge import lxml_tree
Expand Down Expand Up @@ -183,4 +184,4 @@ def join(first, second, *rest):

@registry.filter(name='ansi2html')
def ansi2html(s):
return Ansi2HTMLConverter(inline=True).convert(s, full=False)
return mark_safe(Ansi2HTMLConverter(inline=True).convert(s, full=False))

0 comments on commit 0184aa7

Please sign in to comment.