I mean, do this instead.

This assumes that it uses Markdown
This commit is contained in:
Hans5958 2022-04-07 21:50:28 +07:00
parent f942dea58d
commit af2b9045d8

View file

@ -76,7 +76,9 @@ def remove_extras(entry: dict):
entry[key] = re.sub(r'^(\s+)', r'', entry[key])
entry[key] = re.sub(r'(\s+)$', r'', entry[key])
# Double characters
entry[key] = re.sub(r' {2,}', r' ', entry[key])
entry[key] = re.sub(r' {2,}(?!\n)', r' ', entry[key])
entry[key] = re.sub(r' {3,}\n', r' ', entry[key])
entry[key] = re.sub(r'\n{3,}', r'\n\n', entry[key])
entry[key] = re.sub(r'r\/{2,}', r'r\/', entry[key])
entry[key] = re.sub(r',{2,}', r',', entry[key])
# Psuedo-empty strings