From 4d7b86f1f4057582351e24a6f1c2c057cd410325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michele=20Zuccal=C3=A0?= Date: Fri, 5 Jan 2024 11:54:38 +0100 Subject: [PATCH] optimize html_uniform (#449) --- core/support.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 core/support.py diff --git a/core/support.py b/core/support.py old mode 100755 new mode 100644 index 7ec23087..4b104599 --- a/core/support.py +++ b/core/support.py @@ -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):