MCPcopy
hub / github.com/Python-Markdown/markdown / extendMarkdown

Method extendMarkdown

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

Insert `AbbrTreeprocessor` and `AbbrBlockprocessor`.

(self, md)

Source from the content-addressed store, hash-verified

69 self.glossary = {**dictionary, **self.glossary}
70
71 def extendMarkdown(self, md):
72 """ Insert `AbbrTreeprocessor` and `AbbrBlockprocessor`. """
73 if (self.config['glossary'][0]):
74 self.load_glossary(self.config['glossary'][0])
75 self.abbrs.update(self.glossary)
76 md.registerExtension(self)
77 md.treeprocessors.register(AbbrTreeprocessor(md, self.abbrs), 'abbr', 7)
78 md.parser.blockprocessors.register(AbbrBlockprocessor(md.parser, self.abbrs), 'abbr', 16)
79
80
81class 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