X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/32974185d5e2b1bdc197b4f5dcab259b5de3c6b4..0fef41d028692ec97375b9a10376f2029e519042:/apps/wiki/nice_diff.py diff --git a/apps/wiki/nice_diff.py b/apps/wiki/nice_diff.py old mode 100755 new mode 100644 index 355600b5..19ad602c --- a/apps/wiki/nice_diff.py +++ b/apps/wiki/nice_diff.py @@ -17,11 +17,14 @@ NAMES = {'+': 'added', '-': 'removed', '^': 'changed'} def diff_replace(match): return """""" % NAMES[match.group(1)] + def filter_line(line): - return DIFF_RE.sub(diff_replace, html_escape(line)).replace('\x01', '') + return DIFF_RE.sub(diff_replace, html_escape(line)).replace('\x01', '') + def format_changeset(a, b, change): - return (a[0], filter_line(a[1]), b[0], filter_line(b[1]), change) + return a[0], filter_line(a[1]), b[0], filter_line(b[1]), change + def html_diff_table(la, lb, context=None): all_changes = difflib._mdiff(la, lb)