diff options
-rw-r--r-- | pygments/lexers/web.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pygments/lexers/web.py b/pygments/lexers/web.py index 30429e4b..ccc5c698 100644 --- a/pygments/lexers/web.py +++ b/pygments/lexers/web.py @@ -1514,7 +1514,7 @@ class SassLexer(ExtendedRegexLexer): (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'), ], @@ -1582,7 +1582,8 @@ class ScssLexer(RegexLexer): (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'), ], |