File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -141,14 +141,20 @@ def datafy_ruleset(self, rset):
141141 # TODO test selector?
142142 sel = rset .selector .as_css ()
143143 if sel != '*' :
144- # We replace escaping of the subtract operator because SASS
145- # doesn't like the literal hyphen in selectors.
146- # '-' was not recognized anymore starting around Dec 2014, use \- now.
147- sel = sel .replace ("'-'" , "-" ).replace ("\\ -" , "-" )
148- # Also replace multiple whitespaces (including newlines) with
149- # single space; we don't know how exactly it will perform
150- # otherwise.
151- rdict ['scope' ] = ' ' .join (sel .split ())
144+ # We replace all backslashes in the selector
145+ # for compatibility with the SASS pre-processor.
146+ # Notably, this allows "numeric classes"
147+ # and all operators (including braces).
148+ sel = sel .replace ("\\ " , "" )
149+ # '-' was used initially for only the subtract operator
150+ # but is not recognized anymore starting around Dec 2014.
151+ sel = sel .replace ("'-'" , "-" )
152+ # Also replace multiple whitespaces (including newlines)
153+ # with a single space;
154+ # we don't know how exactly it will perform otherwise.
155+ sel = " " .join (sel .split ())
156+
157+ rdict ['scope' ] = sel
152158
153159 # Arbitrary at-rules -> add to dict
154160 for r in rset .at_rules :
You can’t perform that action at this time.
0 commit comments