mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Handle guess_lexer exceptions in pygments reST directive
This commit is contained in:
parent
6cedd67c38
commit
36bc7ba5b5
3 changed files with 9 additions and 2 deletions
|
@ -135,7 +135,10 @@ class Pygments(Directive):
|
|||
# lexer not found, use default.
|
||||
lexer = TextLexer()
|
||||
else:
|
||||
lexer = guess_lexer(content)
|
||||
try:
|
||||
lexer = guess_lexer(content)
|
||||
except:
|
||||
lexer = TextLexer()
|
||||
|
||||
# import sys
|
||||
# print >>sys.stderr, self.arguments, lexer.__class__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue