Commit 1663d71d authored by Cédric Bellegarde's avatar Cédric Bellegarde

Merge branch 'master' into next

parents 38ef633a 70c24a35
Pipeline #162797 failed with stage
in 48 seconds
......@@ -34,6 +34,8 @@ class CSSRuleList:
self.__rules = []
for child in self.__get_children(css):
child = child.strip()
# Remove any comment
child = re.sub(".*\*\/", "", child)
if child.startswith("@media"):
rule = CSSMediaRule(child, uri, cancellable)
elif child.startswith("@supports"):
......@@ -77,8 +79,6 @@ class CSSRuleList:
"""
children = []
css = css.replace("\n", "").strip()
# Remove comments
css = re.sub("\/\*[^*]*[^/]*\*\/", "", css)
css_split = css.split("}")
bracket_count = 0
children = []
......
......@@ -36,7 +36,7 @@ class CSSStyleRule:
self.__border_str = None
self.__has_background_url = False
# Get selectors
search = search = re.search('^([^{]*){(.*)}', css)
search = re.search('^([^{]*){(.*)}', css)
if search is not None:
self.__selector = search.group(1).strip()
declarations = search.group(2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment