Commits

Natalie Weizenbaum committed 25062dd

Distinguish Sass/SCSS selectors and attributes a bit better.

Comments (0)

Files changed (1)

pygments/lexers/web.py

             (r'([!$][\w-]\w*)([ \t]*(?:(?:\|\|)?=|:))',
              bygroups(Name.Variable, Operator), 'value'),
             (r':', Name.Attribute, 'old-style-attr'),
-            (r'(?=[^\s:"\[]+\s*[=:]([ \t]|$))', Name.Attribute, 'new-style-attr'),
+            (r'(?=.+?[=:]([^a-z]|$))', Name.Attribute, 'new-style-attr'),
             (r'', Text, 'selector'),
         ],
 
             (r'@extend', Keyword, 'selector'),
             (r'@[a-z0-9_-]+', Keyword, 'selector'),
             (r'(\$[\w-]\w*)([ \t]*:)', bygroups(Name.Variable, Operator), 'value'),
-            (r'(?=[^\s:"\[]+\s*:([ \t]|$))', Name.Attribute, 'attr'),
+            (r'(?=[^;{}][;}])', Name.Attribute, 'attr'),
+            (r'(?=[^;{}:]+:[^a-z])', Name.Attribute, 'attr'),
             (r'', Text, 'selector'),
         ],