More diff test normalizing
- Legacy-Id: 443
This commit is contained in:
parent
2c6c881a3d
commit
0f391a1d90
|
@ -28,13 +28,13 @@ def reduce(html, pre=False, fill=True):
|
||||||
html = re.sub(r"(?i)(RFC) (\d+)", r"\1\2", html) # ignore "RFC 1234" vs. "RFC1234" diffs
|
html = re.sub(r"(?i)(RFC) (\d+)", r"\1\2", html) # ignore "RFC 1234" vs. "RFC1234" diffs
|
||||||
html = re.sub(r"\bID\b", r"I-D", html) # idnore " ID " vs. " I-D " diffs
|
html = re.sub(r"\bID\b", r"I-D", html) # idnore " ID " vs. " I-D " diffs
|
||||||
text = html2text(html, pre=pre, fill=fill).strip()
|
text = html2text(html, pre=pre, fill=fill).strip()
|
||||||
text = text.replace(" :", ": ")
|
text = text.replace(" : ", ": ").replace(" :", ": ")
|
||||||
text = text.replace('."', '".')
|
text = text.replace('."', '".')
|
||||||
text = text.replace(',"', '",')
|
text = text.replace(',"', '",')
|
||||||
if pre:
|
if pre:
|
||||||
text = text.split("\n")
|
text = text.split("\n")
|
||||||
else:
|
else:
|
||||||
text = [ line.strip() for line in text.split("\n") ]
|
text = [ line.strip() for line in text.split("\n") if line.strip()]
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def get_patterns(module):
|
def get_patterns(module):
|
||||||
|
|
Loading…
Reference in a new issue