diff options
author | Nathan Weizenbaum <nex342@gmail.com> | 2010-06-05 20:18:41 -0700 |
---|---|---|
committer | Nathan Weizenbaum <nex342@gmail.com> | 2010-06-05 20:18:41 -0700 |
commit | 93fb185320e5bf636c4733fe0a41bc1fb2fd2794 (patch) | |
tree | d89c2f4c707321c66e7694669ed19bb5dc3a2647 | |
parent | c1685040111ee439dd0efe3fea9995df52c6baf4 (diff) | |
download | pygments-93fb185320e5bf636c4733fe0a41bc1fb2fd2794.tar.gz |
Distinguish Sass/SCSS selectors and attributes a bit better.
-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'), ], |