optimize html_uniform (#449)
This commit is contained in:
2
core/support.py
Executable file → Normal file
2
core/support.py
Executable file → Normal 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):
|
||||
|
||||
Reference in New Issue
Block a user