mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-21 22:13:17 +03:00
Use markdown 2.6 extension_configs to configure extension
This commit is contained in:
parent
d9d34e4886
commit
b2e74fb523
|
@ -159,8 +159,15 @@ try:
|
||||||
of '#' style headers to <h2>.
|
of '#' style headers to <h2>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
extensions = ['markdown.extensions.headerid(level=2)']
|
extensions = ['markdown.extensions.headerid']
|
||||||
md = markdown.Markdown(extensions=extensions)
|
extension_configs = {
|
||||||
|
'markdown.extensions.headerid': {
|
||||||
|
'level': '2'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
md = markdown.Markdown(
|
||||||
|
extensions=extensions, extension_configs=extension_configs
|
||||||
|
)
|
||||||
return md.convert(text)
|
return md.convert(text)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
apply_markdown = None
|
apply_markdown = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user