equal
deleted
inserted
replaced
65 |
65 |
66 defaultopts = diffopts() |
66 defaultopts = diffopts() |
67 |
67 |
68 def wsclean(opts, text, blank=True): |
68 def wsclean(opts, text, blank=True): |
69 if opts.ignorews: |
69 if opts.ignorews: |
70 text = re.sub('[ \t\r]+', '', text) |
70 text = bdiff.fixws(text, 1) |
71 elif opts.ignorewsamount: |
71 elif opts.ignorewsamount: |
72 text = re.sub('[ \t\r]+', ' ', text) |
72 text = bdiff.fixws(text, 0) |
73 text = text.replace(' \n', '\n') |
|
74 if blank and opts.ignoreblanklines: |
73 if blank and opts.ignoreblanklines: |
75 text = re.sub('\n+', '\n', text).strip('\n') |
74 text = re.sub('\n+', '\n', text).strip('\n') |
76 return text |
75 return text |
77 |
76 |
78 def splitblock(base1, lines1, base2, lines2, opts): |
77 def splitblock(base1, lines1, base2, lines2, opts): |