Fix #6497: custom lexers fails highlighting when syntax error

This commit is contained in:
Takeshi KOMIYA 2019-06-18 01:43:14 +09:00
parent 5b307fcf4f
commit 2119a65b86
2 changed files with 4 additions and 1 deletions

View File

@ -16,6 +16,8 @@ Features added
Bugs fixed
----------
* #6497: custom lexers fails highlighting when syntax error
Testing
--------

View File

@ -139,7 +139,8 @@ class PygmentsBridge:
lexer = lexers['none']
if lang in lexers:
lexer = lexers[lang]
# just return custom lexers here (without installing raiseonerror filter)
return lexers[lang]
elif lang in lexer_classes:
lexer = lexer_classes[lang](**opts)
else: