mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Make Markdown 2.6 the minimum compatible version (#6576)
This commit is contained in:
parent
2e7ab9d6c6
commit
564faddb0f
|
@ -93,7 +93,7 @@ each Python and Django series.
|
||||||
The following packages are optional:
|
The following packages are optional:
|
||||||
|
|
||||||
* [coreapi][coreapi] (1.32.0+) - Schema generation support.
|
* [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-filter][django-filter] (1.0.1+) - Filtering support.
|
||||||
* [django-crispy-forms][django-crispy-forms] - Improved HTML display for filtering.
|
* [django-crispy-forms][django-crispy-forms] - Improved HTML display for filtering.
|
||||||
* [django-guardian][django-guardian] (1.1.1+) - Object level permissions support.
|
* [django-guardian][django-guardian] (1.1.1+) - Object level permissions support.
|
||||||
|
|
|
@ -143,19 +143,12 @@ if 'patch' not in View.http_method_names:
|
||||||
View.http_method_names = View.http_method_names + ['patch']
|
View.http_method_names = View.http_method_names + ['patch']
|
||||||
|
|
||||||
|
|
||||||
# Markdown is optional
|
# Markdown is optional (version 2.6+ required)
|
||||||
try:
|
try:
|
||||||
import markdown
|
import markdown
|
||||||
|
|
||||||
if markdown.version <= '2.2':
|
HEADERID_EXT_PATH = 'markdown.extensions.toc'
|
||||||
HEADERID_EXT_PATH = 'headerid'
|
LEVEL_PARAM = 'baselevel'
|
||||||
LEVEL_PARAM = 'level'
|
|
||||||
elif markdown.version < '2.6':
|
|
||||||
HEADERID_EXT_PATH = 'markdown.extensions.headerid'
|
|
||||||
LEVEL_PARAM = 'level'
|
|
||||||
else:
|
|
||||||
HEADERID_EXT_PATH = 'markdown.extensions.toc'
|
|
||||||
LEVEL_PARAM = 'baselevel'
|
|
||||||
|
|
||||||
def apply_markdown(text):
|
def apply_markdown(text):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user