mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 11:00:13 +03:00
Update highlight markdown preprocessor to use register (#6412)
With this change, Markdown version requirement can also be bumped up to 3.0.1 to use .register() instead of .add().
This commit is contained in:
parent
7c6e34c14f
commit
14be841e64
|
@ -42,7 +42,8 @@ You can determine your currently installed version using `pip show`:
|
||||||
|
|
||||||
### 3.9.2 - IN DEVELOPMENT
|
### 3.9.2 - IN DEVELOPMENT
|
||||||
|
|
||||||
...
|
* Resolve DeprecationWarning with markdown. [#6317][gh6317]
|
||||||
|
* Upgrade markdown to 3.0.1 to avoid deprecation issue.
|
||||||
|
|
||||||
### 3.9.1
|
### 3.9.1
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Optional packages which may be used with REST framework.
|
# Optional packages which may be used with REST framework.
|
||||||
psycopg2-binary==2.7.5
|
psycopg2-binary==2.7.5
|
||||||
markdown==2.6.11
|
markdown==3.0.1
|
||||||
django-guardian==1.5.0
|
django-guardian==1.5.0
|
||||||
django-filter==1.1.0
|
django-filter==1.1.0
|
||||||
coreapi==2.3.1
|
coreapi==2.3.1
|
||||||
|
|
|
@ -258,7 +258,7 @@ if markdown is not None and pygments is not None:
|
||||||
return ret.split("\n")
|
return ret.split("\n")
|
||||||
|
|
||||||
def md_filter_add_syntax_highlight(md):
|
def md_filter_add_syntax_highlight(md):
|
||||||
md.preprocessors.add('highlight', CodeBlockPreprocessor(), "_begin")
|
md.preprocessors.register(CodeBlockPreprocessor(), 'highlight', 40)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
def md_filter_add_syntax_highlight(md):
|
def md_filter_add_syntax_highlight(md):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user