equal
deleted
inserted
replaced
103 defaultopts = diffopts() |
103 defaultopts = diffopts() |
104 |
104 |
105 |
105 |
106 def wsclean(opts, text, blank=True): |
106 def wsclean(opts, text, blank=True): |
107 if opts.ignorews: |
107 if opts.ignorews: |
108 text = bdiff.fixws(text, 1) |
108 text = bdiff.fixws(text, True) |
109 elif opts.ignorewsamount: |
109 elif opts.ignorewsamount: |
110 text = bdiff.fixws(text, 0) |
110 text = bdiff.fixws(text, False) |
111 if blank and opts.ignoreblanklines: |
111 if blank and opts.ignoreblanklines: |
112 text = re.sub(b'\n+', b'\n', text).strip(b'\n') |
112 text = re.sub(b'\n+', b'\n', text).strip(b'\n') |
113 if opts.ignorewseol: |
113 if opts.ignorewseol: |
114 text = re.sub(br'[ \t\r\f]+\n', br'\n', text) |
114 text = re.sub(br'[ \t\r\f]+\n', br'\n', text) |
115 return text |
115 return text |