Changeset - e46d0a90556e
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-10-27 14:33:29
marcin@python-works.com
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
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/diffs.py
Show inline comments
 
@@ -27,7 +27,6 @@
 

	
 
import re
 
import difflib
 
import markupsafe
 
import logging
 

	
 
from itertools import tee, imap
 
@@ -171,7 +170,9 @@ class DiffProcessor(object):
 
            self.differ = self._highlight_line_udiff
 

	
 
    def escaper(self, string):
 
        return markupsafe.escape(string)
 
        return string.replace('&', '&')\
 
                .replace('<', '&lt;')\
 
                .replace('>', '&gt;')
 

	
 
    def copy_iterator(self):
 
        """
 
@@ -300,6 +301,7 @@ class DiffProcessor(object):
 
        Parse the diff an return data for the template.
 
        """
 
        lineiter = self.lines
 

	
 
        files = []
 
        try:
 
            line = lineiter.next()
 
@@ -323,6 +325,7 @@ class DiffProcessor(object):
 
                })
 

	
 
                line = lineiter.next()
 

	
 
                while line:
 
                    match = self._chunk_re.match(line)
 
                    if not match:
 
@@ -551,6 +554,7 @@ class DiffProcessor(object):
 
                    _html.append('''\n\t\t<pre>%(code)s</pre>\n''' % {
 
                        'code': change['line']
 
                    })
 

	
 
                    _html.append('''\t</td>''')
 
                    _html.append('''\n</tr>\n''')
 
        _html.append('''</table>''')
0 comments (0 inline, 0 general)