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

Method extendMarkdown

markdown/extensions/toc.py:504–517  ·  view source on GitHub ↗

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

(self, md)

Source from the content-addressed store, hash-verified

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