Commits

Anonymous committed 08cdd04

Add xchat irc logs fix from #340 and tweak a pattern

  • Participants
  • Parent commits 7206444
  • Branches trunk

Comments (0)

Files changed (2)

     C99 types.
   * Bash lexer now correctly highlights heredocs without preceeding
     whitespace.
-  * Vim lexer now highlights hex colors properly and knows a couple more
-    keywords.
+  * Vim lexer now highlights hex colors properly and knows a couple
+    more keywords.
+  * Irc logs lexer now handles xchat's default time format (#340)
+    and correctly highlights lines ending in ``>``
+
 - Added "Visual Studio" style.
 
 - Updated markdown processor to Markdown 1.7.

pygments/lexers/text.py

           # weechat
           \d{4}\s\w{3}\s\d{2}\s        # Date
           \d{2}:\d{2}:\d{2}\s+         # Time + Whitespace
+        |
+          # xchat
+          \w{3}\s\d{2}\s               # Date
+          \d{2}:\d{2}:\d{2}\s+         # Time + Whitespace
         )?
     """
     tokens = {
                 # log start/end
             (r'^\*\*\*\*(.*)\*\*\*\*$', Comment),
             # hack
-            ("^" + timestamp + r'(\s*<.*>\s*)$', bygroups(Comment.Preproc, Name.Tag)),
+            ("^" + timestamp + r'(\s*<[^>]*>\s*)$', bygroups(Comment.Preproc, Name.Tag)),
             # normal msgs
             ("^" + timestamp + r"""
                 (\s*<.*?>\s*)          # Nick """,