From f2c7fbdb734cd0d916f34ae799dd01b62c284538 Mon Sep 17 00:00:00 2001 From: Sudipto Chandra Date: Thu, 24 Nov 2022 05:19:53 +0400 Subject: [PATCH 1/2] Add missing raw string flags --- css_html_js_minify/html_minifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css_html_js_minify/html_minifier.py b/css_html_js_minify/html_minifier.py index da9b646..520ba9d 100644 --- a/css_html_js_minify/html_minifier.py +++ b/css_html_js_minify/html_minifier.py @@ -106,10 +106,10 @@ def unquote_html_attributes(html): space1 = re.compile(r'\w\s+\w', re.MULTILINE) space2 = re.compile(r'"\s+>', re.MULTILINE) space3 = re.compile(r"'\s+>", re.MULTILINE) - space4 = re.compile('"\s\s+\w+="|\'\s\s+\w+=\'|"\s\s+\w+=|\'\s\s+\w+=', + space4 = re.compile(r'"\s\s+\w+="|\'\s\s+\w+=\'|"\s\s+\w+=|\'\s\s+\w+=', re.MULTILINE) space6 = re.compile(r"\d\s+>", re.MULTILINE) - quotes_in_tag = re.compile('([a-zA-Z]+)="([a-zA-Z0-9-_\.]+)"') + quotes_in_tag = re.compile(r'([a-zA-Z]+)="([a-zA-Z0-9-_\.]+)"') # iterate on a for loop cleaning stuff up on the html markup. for tag in iter(any_tag.findall(html)): # exceptions of comments and closing tags From 08722baaf1816fa47d60162db0e8e001c0850004 Mon Sep 17 00:00:00 2001 From: Sudipto Chandra Date: Thu, 24 Nov 2022 05:21:07 +0400 Subject: [PATCH 2/2] Add missing raw string flags --- css_html_js_minify/css_minifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css_html_js_minify/css_minifier.py b/css_html_js_minify/css_minifier.py index 1bb7c17..580310f 100644 --- a/css_html_js_minify/css_minifier.py +++ b/css_html_js_minify/css_minifier.py @@ -291,7 +291,7 @@ def restore_needed_space(css): def unquote_selectors(css): """Fix CSS for some specific selectors where Quotes is not needed.""" - return re.compile('([a-zA-Z]+)="([a-zA-Z0-9-_\.]+)"]').sub(r'\1=\2]', css) + return re.compile(r'([a-zA-Z]+)="([a-zA-Z0-9-_\.]+)"]').sub(r'\1=\2]', css) def css_minify(css, wrap=False, comments=False, sort=False, noprefix=False):