# HG changeset patch # User Marcin Kuzminski # Date 1351341209 -7200 # Node ID e46d0a90556e912d132620e7c463187b3c57a0d9 # Parent 566f0166f21ec92383ee8bbfec7bf0f2b4405d60 fixes #612 Double quotes to Single quotes result in 4; to 9; in a visual Diff. Markupsafe.escape method usage was causing some unpredictable behavior diff -r 566f0166f21e -r e46d0a90556e rhodecode/lib/diffs.py --- a/rhodecode/lib/diffs.py Sat Oct 27 00:51:08 2012 +0200 +++ b/rhodecode/lib/diffs.py Sat Oct 27 14:33:29 2012 +0200 @@ -27,7 +27,6 @@ import re import difflib -import markupsafe import logging from itertools import tee, imap @@ -171,7 +170,9 @@ self.differ = self._highlight_line_udiff def escaper(self, string): - return markupsafe.escape(string) + return string.replace('&', '&')\ + .replace('<', '<')\ + .replace('>', '>') def copy_iterator(self): """ @@ -300,6 +301,7 @@ Parse the diff an return data for the template. """ lineiter = self.lines + files = [] try: line = lineiter.next() @@ -323,6 +325,7 @@ }) line = lineiter.next() + while line: match = self._chunk_re.match(line) if not match: @@ -551,6 +554,7 @@ _html.append('''\n\t\t
%(code)s
\n''' % { 'code': change['line'] }) + _html.append('''\t''') _html.append('''\n\n''') _html.append('''''')