mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Add import for TextLexer. (#5512)
If pygments did not recognize the language name it was being passed, this would raise a `NameError` because `TextLexer` import was missing.
This commit is contained in:
parent
1a526c153e
commit
e704dd2e40
|
@ -214,7 +214,7 @@ except ImportError:
|
|||
|
||||
try:
|
||||
import pygments
|
||||
from pygments.lexers import get_lexer_by_name
|
||||
from pygments.lexers import get_lexer_by_name, TextLexer
|
||||
from pygments.formatters import HtmlFormatter
|
||||
|
||||
def pygments_highlight(text, lang, style):
|
||||
|
|
Loading…
Reference in New Issue
Block a user