This commit is contained in:
David Smith 2020-08-17 21:26:56 +01:00 committed by GitHub
parent 3d708ac700
commit 355afcf64b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 5 deletions

View File

@ -4,4 +4,4 @@ flake8-tidy-imports==4.1.0
pycodestyle==2.5.0 pycodestyle==2.5.0
# Sort and lint imports # Sort and lint imports
isort==4.3.21 isort==5.4.2

View File

@ -96,8 +96,8 @@ except ImportError:
try: try:
import pygments import pygments
from pygments.lexers import get_lexer_by_name, TextLexer
from pygments.formatters import HtmlFormatter from pygments.formatters import HtmlFormatter
from pygments.lexers import TextLexer, get_lexer_by_name
def pygments_highlight(text, lang, style): def pygments_highlight(text, lang, style):
lexer = get_lexer_by_name(lang, stripall=False) lexer = get_lexer_by_name(lang, stripall=False)
@ -121,9 +121,10 @@ if markdown is not None and pygments is not None:
# starting from this blogpost and modified to support current markdown extensions API # starting from this blogpost and modified to support current markdown extensions API
# https://zerokspot.com/weblog/2008/06/18/syntax-highlighting-in-markdown-with-pygments/ # https://zerokspot.com/weblog/2008/06/18/syntax-highlighting-in-markdown-with-pygments/
from markdown.preprocessors import Preprocessor
import re import re
from markdown.preprocessors import Preprocessor
class CodeBlockPreprocessor(Preprocessor): class CodeBlockPreprocessor(Preprocessor):
pattern = re.compile( pattern = re.compile(
r'^\s*``` *([^\n]+)\n(.+?)^\s*```', re.M | re.S) r'^\s*``` *([^\n]+)\n(.+?)^\s*```', re.M | re.S)

View File

@ -11,7 +11,7 @@ PYTEST_ARGS = {
FLAKE8_ARGS = ['rest_framework', 'tests'] FLAKE8_ARGS = ['rest_framework', 'tests']
ISORT_ARGS = ['--recursive', '--check-only', '--diff', 'rest_framework', 'tests'] ISORT_ARGS = ['--check-only', '--diff', 'rest_framework', 'tests']
def exit_on_failure(ret, message=None): def exit_on_failure(ret, message=None):

View File

@ -13,7 +13,7 @@ banned-modules = json = use from rest_framework.utils import json!
skip=.tox skip=.tox
atomic=true atomic=true
multi_line_output=5 multi_line_output=5
known_standard_library=types extra_standard_library=types
known_third_party=pytest,_pytest,django,pytz,uritemplate known_third_party=pytest,_pytest,django,pytz,uritemplate
known_first_party=rest_framework,tests known_first_party=rest_framework,tests