mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
fix #6203, markdown 3.0 change version attribute
This commit is contained in:
parent
d976ac56b0
commit
455910fe38
|
@ -161,10 +161,16 @@ if 'patch' not in View.http_method_names:
|
|||
try:
|
||||
import markdown
|
||||
|
||||
if markdown.version <= '2.2':
|
||||
if hasattr(markdown, 'version'):
|
||||
markdown_version = markdown.version
|
||||
else:
|
||||
# >= 3.0
|
||||
markdown_version = markdown.__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