optimize html_uniform (#449)

This commit is contained in:
Michele Zuccalà
2024-01-05 11:54:38 +01:00
committed by marco
parent daad0c3555
commit 4d7b86f1f4

2
core/support.py Executable file → Normal file
View File

@@ -496,7 +496,7 @@ def html_uniform(data):
"""
replace all ' with " and eliminate newline, so we don't need to worry about
"""
return re.sub("='([^']+)'", '="\\1"', data.replace('\n', ' ').replace('\t', ' ').replace(' ', ' '))
return re.sub(r"\s+| ", " " , re.sub("='([^']+)'", '="\\1"', data))
def scrape(func):