MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / run

Method run

markdown/extensions/footnotes.py:279–295  ·  view source on GitHub ↗
(self, root)

Source from the content-addressed store, hash-verified

277 self.footnotes = footnotes
278
279 def run(self, root):
280 footnotesDiv = self.footnotes.makeFootnotesDiv(root)
281 if footnotesDiv:
282 result = self.footnotes.findFootnotesPlaceholder(root)
283 if result:
284 node, isText = result
285 if isText:
286 node.text = None
287 node.getchildren().insert(0, footnotesDiv)
288 else:
289 child, element = node
290 ind = element.getchildren().find(child)
291 element.getchildren().insert(ind + 1, footnotesDiv)
292 child.tail = None
293 fnPlaceholder.parent.replaceChild(fnPlaceholder, footnotesDiv)
294 else:
295 root.append(footnotesDiv)
296
297class FootnotePostprocessor(markdown.postprocessors.Postprocessor):
298 """ Replace placeholders with html entities. """

Callers

nothing calls this directly

Calls 6

makeFootnotesDivMethod · 0.80
replaceChildMethod · 0.80
insertMethod · 0.45
findMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected