mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 11:00:13 +03:00
Merge 8c23432060
into 878f9d2783
This commit is contained in:
commit
92859493c9
|
@ -161,10 +161,22 @@ if 'patch' not in View.http_method_names:
|
|||
try:
|
||||
import markdown
|
||||
|
||||
if markdown.version <= '2.2':
|
||||
try:
|
||||
# for Markdown < 3.0
|
||||
markdown_version = markdown.version
|
||||
except AttributeError:
|
||||
# for Markdown >= 3.0
|
||||
try:
|
||||
markdown_version = markdown.__version__
|
||||
except AttributeError:
|
||||
import warnings
|
||||
warnings.warn("Cannot decide Markdown's version", ImportWarning)
|
||||
raise ImportError("Cannot decide Markdown's version")
|
||||
|
||||
if markdown_version <= '2.2':
|
||||
HEADERID_EXT_PATH = 'headerid'
|
||||
LEVEL_PARAM = 'level'
|
||||
elif markdown.version < '2.6':
|
||||
elif markdown_version < '2.6':
|
||||
HEADERID_EXT_PATH = 'markdown.extensions.headerid'
|
||||
LEVEL_PARAM = 'level'
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user