##// END OF EJS Templates
fixes #612 Double quotes to Single quotes result in 4; to 9; in a visual Diff. Markupsafe.escape method usage...
marcink -
r2967:e46d0a90 beta
parent child Browse files
Show More
@@ -27,7 +27,6 b''
27
27
28 import re
28 import re
29 import difflib
29 import difflib
30 import markupsafe
31 import logging
30 import logging
32
31
33 from itertools import tee, imap
32 from itertools import tee, imap
@@ -171,7 +170,9 b' class DiffProcessor(object):'
171 self.differ = self._highlight_line_udiff
170 self.differ = self._highlight_line_udiff
172
171
173 def escaper(self, string):
172 def escaper(self, string):
174 return markupsafe.escape(string)
173 return string.replace('&', '&')\
174 .replace('<', '&lt;')\
175 .replace('>', '&gt;')
175
176
176 def copy_iterator(self):
177 def copy_iterator(self):
177 """
178 """
@@ -300,6 +301,7 b' class DiffProcessor(object):'
300 Parse the diff an return data for the template.
301 Parse the diff an return data for the template.
301 """
302 """
302 lineiter = self.lines
303 lineiter = self.lines
304
303 files = []
305 files = []
304 try:
306 try:
305 line = lineiter.next()
307 line = lineiter.next()
@@ -323,6 +325,7 b' class DiffProcessor(object):'
323 })
325 })
324
326
325 line = lineiter.next()
327 line = lineiter.next()
328
326 while line:
329 while line:
327 match = self._chunk_re.match(line)
330 match = self._chunk_re.match(line)
328 if not match:
331 if not match:
@@ -551,6 +554,7 b' class DiffProcessor(object):'
551 _html.append('''\n\t\t<pre>%(code)s</pre>\n''' % {
554 _html.append('''\n\t\t<pre>%(code)s</pre>\n''' % {
552 'code': change['line']
555 'code': change['line']
553 })
556 })
557
554 _html.append('''\t</td>''')
558 _html.append('''\t</td>''')
555 _html.append('''\n</tr>\n''')
559 _html.append('''\n</tr>\n''')
556 _html.append('''</table>''')
560 _html.append('''</table>''')
General Comments 0
You need to be logged in to leave comments. Login now