mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-30 18:09:59 +03:00
Only support markdown 2.6+
This commit is contained in:
parent
bfa42cf0a8
commit
64b311a816
|
@ -93,7 +93,7 @@ each Python and Django series.
|
|||
The following packages are optional:
|
||||
|
||||
* [coreapi][coreapi] (1.32.0+) - Schema generation support.
|
||||
* [Markdown][markdown] (2.1.0+) - Markdown support for the browsable API.
|
||||
* [Markdown][markdown] (2.6.0+) - Markdown support for the browsable API.
|
||||
* [django-filter][django-filter] (1.0.1+) - Filtering support.
|
||||
* [django-crispy-forms][django-crispy-forms] - Improved HTML display for filtering.
|
||||
* [django-guardian][django-guardian] (1.1.1+) - Object level permissions support.
|
||||
|
|
|
@ -8,7 +8,7 @@ ______ _____ _____ _____ __
|
|||
"""
|
||||
|
||||
__title__ = 'Django REST framework'
|
||||
__version__ = '3.9.2'
|
||||
__version__ = '3.9.2.2'
|
||||
__author__ = 'Tom Christie'
|
||||
__license__ = 'BSD 2-Clause'
|
||||
__copyright__ = 'Copyright 2011-2019 Encode OSS Ltd'
|
||||
|
|
|
@ -180,21 +180,12 @@ if 'patch' not in View.http_method_names:
|
|||
View.http_method_names = View.http_method_names + ['patch']
|
||||
|
||||
|
||||
# Markdown is optional
|
||||
# Markdown is optional (version 2.6+ required)
|
||||
try:
|
||||
import markdown
|
||||
|
||||
if not hasattr(markdown, '__version__') and markdown.version <= '2.2':
|
||||
HEADERID_EXT_PATH = 'headerid'
|
||||
LEVEL_PARAM = 'level'
|
||||
elif ((not hasattr(markdown, '__version__')
|
||||
) or ((not isinstance(markdown.__version__, type(''))
|
||||
) and markdown.version < '2.6')):
|
||||
HEADERID_EXT_PATH = 'markdown.extensions.headerid'
|
||||
LEVEL_PARAM = 'level'
|
||||
else:
|
||||
HEADERID_EXT_PATH = 'markdown.extensions.toc'
|
||||
LEVEL_PARAM = 'baselevel'
|
||||
HEADERID_EXT_PATH = 'markdown.extensions.toc'
|
||||
LEVEL_PARAM = 'baselevel'
|
||||
|
||||
def apply_markdown(text):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user