Changeset - 3fb80ff77bda
[Not reviewed]
default
0 1 0
Mads Kiilerich - 5 years ago 2020-10-28 14:51:26
mads@kiilerich.com
Grafted from: 132ee6cecca1
diffs: simplify trick to avoid "trailing space" markup of empty diff lines
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/diffs.py
Show inline comments
 
@@ -445,7 +445,7 @@ class DiffProcessor(object):
 
        return self.adds, self.removes
 

	
 

	
 
_escape_re = re.compile(r'(&)|(<)|(>)|(\t)|(\r)|(?<=.)( $)|(\t$)')
 
_escape_re = re.compile(r'(&)|(<)|(>)|(\t)|(\r)|( $)|(\t$)')
 

	
 

	
 
def _escaper(diff_line):
 
@@ -503,6 +503,8 @@ def _escaper(diff_line):
 
        if groups[4]:
 
            return '<u class="cr"></u>'
 
        if groups[5]:
 
            if m.start() == 0:
 
                return ' '  # first column space shouldn't make empty lines show up as trailing space
 
            return ' <i></i>'
 
        if groups[6]:
 
            return '<u>\t</u><i></i>'
0 comments (0 inline, 0 general)