Ritvik19's picture
Add all files and directories
c8a32e7
raw
history blame
No virus
248 Bytes
import re
def cleanup_text(full_text):
full_text = re.sub(r'\n{3,}', '\n\n', full_text)
full_text = re.sub(r'(\n\s){3,}', '\n\n', full_text)
full_text = full_text.replace('\xa0', ' ') # Replace non-breaking spaces
return full_text