Skip to content

Commit 07f40f1

Browse files
timgates42sigvef
authored andcommitted
Make Markdown 2.6 the minimum compatible version (encode#6576)
1 parent 26543d4 commit 07f40f1

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ each Python and Django series.
9393
The following packages are optional:
9494

9595
* [coreapi][coreapi] (1.32.0+) - Schema generation support.
96-
* [Markdown][markdown] (2.1.0+) - Markdown support for the browsable API.
96+
* [Markdown][markdown] (2.6.0+) - Markdown support for the browsable API.
9797
* [django-filter][django-filter] (1.0.1+) - Filtering support.
9898
* [django-crispy-forms][django-crispy-forms] - Improved HTML display for filtering.
9999
* [django-guardian][django-guardian] (1.1.1+) - Object level permissions support.

rest_framework/compat.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,12 @@ def is_guardian_installed():
143143
View.http_method_names = View.http_method_names + ['patch']
144144

145145

146-
# Markdown is optional
146+
# Markdown is optional (version 2.6+ required)
147147
try:
148148
import markdown
149149

150-
if markdown.version <= '2.2':
151-
HEADERID_EXT_PATH = 'headerid'
152-
LEVEL_PARAM = 'level'
153-
elif markdown.version < '2.6':
154-
HEADERID_EXT_PATH = 'markdown.extensions.headerid'
155-
LEVEL_PARAM = 'level'
156-
else:
157-
HEADERID_EXT_PATH = 'markdown.extensions.toc'
158-
LEVEL_PARAM = 'baselevel'
150+
HEADERID_EXT_PATH = 'markdown.extensions.toc'
151+
LEVEL_PARAM = 'baselevel'
159152

160153
def apply_markdown(text):
161154
"""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy