Skip to content

Commit e704dd2

Browse files
dmwyattcarltongibson
authored andcommitted
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.
1 parent 1a526c1 commit e704dd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def apply_markdown(text):
214214

215215
try:
216216
import pygments
217-
from pygments.lexers import get_lexer_by_name
217+
from pygments.lexers import get_lexer_by_name, TextLexer
218218
from pygments.formatters import HtmlFormatter
219219

220220
def pygments_highlight(text, lang, style):

0 commit comments

Comments
 (0)