diff options
author | Georg Brandl <georg@python.org> | 2014-11-06 10:24:04 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-11-06 10:24:04 +0100 |
commit | 230bbc2c85bc7104a74c598ec34988a6c06feaf3 (patch) | |
tree | 916931caac66081c15d3724504e66a567784ac57 | |
parent | bf5d611a9a1b276b5997cf7b9b2dc10ed8bc3c5b (diff) | |
download | pygments-230bbc2c85bc7104a74c598ec34988a6c06feaf3.tar.gz |
Scss: fix @media highlight and endless state stacking without #pop
-rw-r--r-- | pygments/lexers/css.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pygments/lexers/css.py b/pygments/lexers/css.py index 61a08d4b..45884558 100644 --- a/pygments/lexers/css.py +++ b/pygments/lexers/css.py @@ -471,6 +471,7 @@ class ScssLexer(RegexLexer): (r'(@mixin)( [\w-]+)', bygroups(Keyword, Name.Function), 'value'), (r'(@include)( [\w-]+)', bygroups(Keyword, Name.Decorator), 'value'), (r'@extend', Keyword, 'selector'), + (r'(@media)(\s+)', bygroups(Keyword, Text), 'value'), (r'@[\w-]+', Keyword, 'selector'), (r'(\$[\w-]*\w)([ \t]*:)', bygroups(Name.Variable, Operator), 'value'), (r'(?=[^;{}][;}])', Name.Attribute, 'attr'), @@ -492,5 +493,5 @@ class ScssLexer(RegexLexer): } for group, common in iteritems(common_sass_tokens): tokens[group] = copy.copy(common) - tokens['value'].extend([(r'\n', Text), (r'[;{}]', Punctuation, 'root')]) - tokens['selector'].extend([(r'\n', Text), (r'[;{}]', Punctuation, 'root')]) + tokens['value'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')]) + tokens['selector'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')]) |