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

Method run

markdown/extensions/footnotes.py:425–439  ·  view source on GitHub ↗
(self, root: etree.Element)

Source from the content-addressed store, hash-verified

423 self.footnotes = footnotes
424
425 def run(self, root: etree.Element) -> None:
426 footnotesDiv = self.footnotes.makeFootnotesDiv(root)
427 if footnotesDiv is not None:
428 result = self.footnotes.findFootnotesPlaceholder(root)
429 if result:
430 child, parent, isText = result
431 ind = list(parent).index(child)
432 if isText:
433 parent.remove(child)
434 parent.insert(ind, footnotesDiv)
435 else:
436 parent.insert(ind + 1, footnotesDiv)
437 child.tail = None
438 else:
439 root.append(footnotesDiv)
440
441
442class FootnoteReorderingProcessor(Treeprocessor):

Callers

nothing calls this directly

Calls 2

makeFootnotesDivMethod · 0.80

Tested by

no test coverage detected