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

Method extendMarkdown

markdown/extensions/abbr.py:71–87  ·  view source on GitHub ↗

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

(self, md)

Source from the content-addressed store, hash-verified

69 self.glossary = {**dictionary, **self.glossary}
70
71 def extendMarkdown(self, md):
72 """
73 Register the processors.
74
75 | Class Instance | Registry | Name | Priority |
76 | ------------------------------------------------------------------- | ---------------------------------------------------------------- | ------ | :------: |
77 | [`AbbrTreeprocessor`][markdown.extensions.abbr.AbbrTreeprocessor] | [`treeprocessors`][markdown.treeprocessors.build_treeprocessors] | `abbr` | `7` |
78 | [`AbbrBlockprocessor`][markdown.extensions.abbr.AbbrBlockprocessor] | [`blockprocessors`][markdown.blockprocessors.build_block_parser] | `abbr` | `16` |
79
80 """
81 # flake8: noqa: E501 75-78
82 if (self.config['glossary'][0]):
83 self.load_glossary(self.config['glossary'][0])
84 self.abbrs.update(self.glossary)
85 md.registerExtension(self)
86 md.treeprocessors.register(AbbrTreeprocessor(md, self.abbrs), 'abbr', 7)
87 md.parser.blockprocessors.register(AbbrBlockprocessor(md.parser, self.abbrs), 'abbr', 16)
88
89
90class AbbrTreeprocessor(Treeprocessor):

Callers

nothing calls this directly

Calls 5

load_glossaryMethod · 0.95
AbbrTreeprocessorClass · 0.85
AbbrBlockprocessorClass · 0.85
registerExtensionMethod · 0.80
registerMethod · 0.80

Tested by

no test coverage detected