MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / extendMarkdown

Method extendMarkdown

markdown/extensions/toc.py:475–488  ·  view source on GitHub ↗

Register the processor. | Class Instance | Registry | Name | Priority | | -------------------------------------------------------------- | -------------------------------------

(self, md)

Source from the content-addressed store, hash-verified

473 super().__init__(**kwargs)
474
475 def extendMarkdown(self, md):
476 """ Register the processor.
477
478 | Class Instance | Registry | Name | Priority |
479 | -------------------------------------------------------------- | ---------------------------------------------------------------- | ------ | :------: |
480 | [`TocTreeprocessor`][markdown.extensions.toc.TocTreeprocessor] | [`treeprocessors`][markdown.treeprocessors.build_treeprocessors] | `toc` | `5` |
481
482 """
483 # flake8: noqa: E501 478-480
484 md.registerExtension(self)
485 self.md = md
486 self.reset()
487 tocext = self.TreeProcessorClass(md, self.getConfigs())
488 md.treeprocessors.register(tocext, 'toc', 5)
489
490 def reset(self) -> None:
491 self.md.toc = ''

Callers 1

registerExtensionsMethod · 0.45

Calls 4

resetMethod · 0.95
registerExtensionMethod · 0.80
getConfigsMethod · 0.80
registerMethod · 0.80

Tested by

no test coverage detected