From: Andy Doan Date: Tue, 16 Feb 2016 21:20:00 +0000 (-0600) Subject: templatetags: fix syntax display of CRLF's X-Git-Tag: v1.1.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7591971245aa8d43b21f1f429a223fc0792f2274;p=thirdparty%2Fpatchwork.git templatetags: fix syntax display of CRLF's Patches that include CRLF's include extra lines in the UI. Rather than each patch line being: content Its source will be: content Signed-off-by: Andy Doan Acked-by: Stephen Finucane --- diff --git a/patchwork/templatetags/syntax.py b/patchwork/templatetags/syntax.py index 1f7e7181..2a4164d6 100644 --- a/patchwork/templatetags/syntax.py +++ b/patchwork/templatetags/syntax.py @@ -59,7 +59,7 @@ _span = '%s' @register.filter def patchsyntax(patch): - content = escape(patch.content) + content = escape(patch.content).replace('\r\n', '\n') for (r, cls) in _patch_span_res: content = r.sub(lambda x: _span % (cls, x.group(0)), content)