1. raichoo
  2. pygments-main

Commits

Georg Brandl  committed e586a49

Closes #862: better guess for shell lexer.

  • Participants
  • Parent commits d1aebb4
  • Branches default

Comments (0)

Files changed (1)

File pygments/lexers/shell.py

View file
  • Ignore whitespace
     }
 
     def analyse_text(text):
-        return shebang_matches(text, r'(ba|z|)sh')
+        if shebang_matches(text, r'(ba|z|)sh'):
+            return 1
+        if text.startswith('$ '):
+            return 0.2
 
 
 class BashSessionLexer(Lexer):