Merge pull request #6502 from tk0miya/6497_custom_lexers_fails_highlighting

Fix #6497: custom lexers fails highlighting when syntax error
This commit is contained in:
Takeshi KOMIYA 2019-06-18 21:36:36 +09:00 committed by GitHub
commit be0856190f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

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

View File

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