Skip to content
Snippets Groups Projects
Commit c757a9b7 authored by Julien (jvoisin) Voisin's avatar Julien (jvoisin) Voisin
Browse files

Fix a bug in css cleaning

It's not mandatory to actually have a comment inside
comment delimiter, like `/**/`.
parent dda30c48
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ class CSSParser(abstract.AbstractParser):
def remove_all(self) -> bool:
with open(self.filename, encoding='utf-8') as f:
cleaned = re.sub(r'/\*.+?\*/', '', f.read(), 0, self.flags)
cleaned = re.sub(r'/\*.*?\*/', '', f.read(), 0, self.flags)
with open(self.output_filename, 'w', encoding='utf-8') as f:
f.write(cleaned)
return True
......@@ -22,7 +22,7 @@ class CSSParser(abstract.AbstractParser):
def get_meta(self) -> Dict[str, Any]:
metadata = {}
with open(self.filename, encoding='utf-8') as f:
cssdoc = re.findall(r'/\*(.+?)\*/', f.read(), self.flags)
cssdoc = re.findall(r'/\*(.*?)\*/', f.read(), self.flags)
for match in cssdoc:
for line in match.splitlines():
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment