mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
markdown: Migrate off deprecated extension registration interface.
Fixes #15205. https://python-markdown.github.io/change_log/release-3.0/#homegrown-ordereddict-has-been-replaced-with-a-purpose-built-registry https://python-markdown.github.io/change_log/release-3.0/#md_globals-keyword-deprecated-from-extension-api The priority numbers are arbitrarily chosen to preserve the existing order. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
84142df152
commit
254b904965
@@ -8,11 +8,11 @@ from zerver.lib.markdown import ResultWithFamily, walk_tree_with_family
|
||||
|
||||
|
||||
class NestedCodeBlocksRenderer(Extension):
|
||||
def extendMarkdown(self, md: markdown.Markdown, md_globals: Dict[str, Any]) -> None:
|
||||
md.treeprocessors.add(
|
||||
'nested_code_blocks',
|
||||
def extendMarkdown(self, md: markdown.Markdown) -> None:
|
||||
md.treeprocessors.register(
|
||||
NestedCodeBlocksRendererTreeProcessor(md, self.getConfigs()),
|
||||
'_end',
|
||||
'nested_code_blocks',
|
||||
-500,
|
||||
)
|
||||
|
||||
class NestedCodeBlocksRendererTreeProcessor(markdown.treeprocessors.Treeprocessor):
|
||||
|
||||
Reference in New Issue
Block a user