Skip to content

Commit

Permalink
Corrige l'affichage HTML des diffs de contenus
Browse files Browse the repository at this point in the history
  • Loading branch information
vhf committed Aug 5, 2017
1 parent f951949 commit 0d09ba2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zds/utils/templatetags/htmldiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from difflib import HtmlDiff
from django import template
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _


Expand All @@ -19,4 +21,4 @@ def htmldiff(string1, string2):
if u'<td>&nbsp;No Differences Found&nbsp;</td>' in result:
return _(u'<p>Pas de changements.</p>')
else:
return u'<div class="diff_delta">{}</div>'.format(result)
return format_html('<div class="diff_delta">{}</div>', mark_safe(result))

0 comments on commit 0d09ba2

Please sign in to comment.