Commits

Anonymous committed 6a97fb3

[svn] Fix an error in GenshiTextLexer and DelegatingLexer.

Comments (0)

Files changed (2)

                 buffered += v
             else:
                 lng_buffer.append((i, t, v))
-        # the last "\n" should always be lexed by the root lexer
+        if lng_buffer:
+            insertions.append((len(buffered), lng_buffer))
         return do_insertions(insertions,
                              self.root_lexer.get_tokens_unprocessed(buffered))
 

pygments/lexers/templates.py

 
     tokens = {
         'root': [
-            (r'[^#\$\s]+', Text),
+            (r'[^#\$\s]+', Other),
             (r'^(\s*)(##.*)$', bygroups(Text, Comment)),
             (r'^(\s*)(#)', bygroups(Text, Comment.Preproc), 'directive'),
             include('variable'),
-            (r'[#\$\s]', Text),
+            (r'[#\$\s]', Other),
         ],
         'directive': [
             (r'\n', Text, '#pop'),