Skip to content

Commit

Permalink
Fix sphinx-doc#6497: custom lexers fails highlighting when syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Jun 17, 2019
1 parent 5b307fc commit 2119a65
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 2119a65

Please sign in to comment.