Skip to content

Commit

Permalink
Merge pull request #6502 from tk0miya/6497_custom_lexers_fails_highli…
Browse files Browse the repository at this point in the history
…ghting

Fix #6497: custom lexers fails highlighting when syntax error
  • Loading branch information
tk0miya committed Jun 18, 2019
2 parents 5b307fc + 2119a65 commit be08561
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES
Expand Up @@ -16,6 +16,8 @@ Features added
Bugs fixed
----------

* #6497: custom lexers fails highlighting when syntax error

Testing
--------

Expand Down
3 changes: 2 additions & 1 deletion sphinx/highlighting.py
Expand Up @@ -139,7 +139,8 @@ def get_lexer(self, source, lang, opts=None, force=False, location=None):
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:
Expand Down

0 comments on commit be08561

Please sign in to comment.