Closed DonKult closed 1 year ago
Hi,
the API was changed in 3.0 already, but with 3.4 the old APIs (and deprecation warnings I at least haven't seen) were removed.
References:
This diff seems to work for me, but as I have no idea what a good int value for priority should be (as _end is not accepted) I am just dropping this here – also, no idea how backward compatible that API is and/or if that is a concern.
priority
_end
diff --git a/staticsite/features/markdown.py b/staticsite/features/markdown.py --- a/staticsite/features/markdown.py +++ b/staticsite/features/markdown.py @@ -120,10 +120,10 @@ class LinkResolver(markdown.treeprocessors.Treeprocessor): class StaticSiteExtension(markdown.extensions.Extension): - def extendMarkdown(self, md, md_globals): + def extendMarkdown(self, md): self.link_resolver = LinkResolver(md) # Insert instance of 'mypattern' before 'references' pattern - md.treeprocessors.add('staticsite', self.link_resolver, '_end') + md.treeprocessors.register(self.link_resolver, 'staticsite', 50) md.registerExtension(self) def reset(self):
Hi,
the API was changed in 3.0 already, but with 3.4 the old APIs (and deprecation warnings I at least haven't seen) were removed.
References:
This diff seems to work for me, but as I have no idea what a good int value for
priority
should be (as_end
is not accepted) I am just dropping this here – also, no idea how backward compatible that API is and/or if that is a concern.