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

Method extendMarkdown

markdown/extensions/toc.py:498–511  ·  view source on GitHub ↗

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

(self, md)

Source from the content-addressed store, hash-verified

496 super().__init__(**kwargs)
497
498 def extendMarkdown(self, md):
499 """ Register the processor.
500
501 | Class Instance | Registry | Name | Priority |
502 | -------------------------------------------------------------- | ---------------------------------------------------------------- | ------ | :------: |
503 | [`TocTreeprocessor`][markdown.extensions.toc.TocTreeprocessor] | [`treeprocessors`][markdown.treeprocessors.build_treeprocessors] | `toc` | `5` |
504
505 """
506 # flake8: noqa: E501 478-480
507 md.registerExtension(self)
508 self.md = md
509 self.reset()
510 tocext = self.TreeProcessorClass(md, self.getConfigs())
511 md.treeprocessors.register(tocext, 'toc', 5)
512
513 def reset(self) -> None:
514 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