utils: Update Markdown local links extension to the new API
The Markdown extension for rewriting local links was using an API that is now deprecated, and as of python-markdown 3.4 it is no longer available. This patch adjusts the code to use the new API which should be available from 3.0 onwards.
This commit is contained in:
parent
9f3df4899f
commit
15547b2796
6
utils.py
6
utils.py
@ -177,7 +177,7 @@ if markdown:
|
|||||||
tag.set("href", new_target)
|
tag.set("href", new_target)
|
||||||
|
|
||||||
class RewriteLocalLinksExtension(markdown.Extension):
|
class RewriteLocalLinksExtension(markdown.Extension):
|
||||||
def extendMarkdown(self, md, md_globals):
|
def extendMarkdown(self, md):
|
||||||
md.treeprocessors.add(
|
md.treeprocessors.register(
|
||||||
"RewriteLocalLinks", RewriteLocalLinks(), "_end"
|
RewriteLocalLinks(), "RewriteLocalLinks", 1000
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user