diff --git a/requirements/requirements-optionals.txt b/requirements/requirements-optionals.txt index bc20c739a..d38ede9ba 100644 --- a/requirements/requirements-optionals.txt +++ b/requirements/requirements-optionals.txt @@ -1,6 +1,7 @@ # Optional packages which may be used with REST framework. psycopg2-binary>=2.8.2, <2.9 -markdown==2.6.11 +markdown==3.1.1 +pygments==2.4.2 django-guardian==1.5.0 django-filter>=2.1.0, <2.2 coreapi==2.3.1 diff --git a/rest_framework/compat.py b/rest_framework/compat.py index 863d64406..17f28a477 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -206,7 +206,7 @@ if markdown is not None and pygments is not None: return ret.split("\n") def md_filter_add_syntax_highlight(md): - md.preprocessors.add('highlight', CodeBlockPreprocessor(), "_begin") + md.preprocessors.register(CodeBlockPreprocessor(), 'highlight', 40) return True else: def md_filter_add_syntax_highlight(md):