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

Method run

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

Source from the content-addressed store, hash-verified

440 self.footnotes = footnotes
441
442 def run(self, root: etree.Element) -> None:
443 footnotesDiv = self.footnotes.makeFootnotesDiv(root)
444 if footnotesDiv is not None:
445 result = self.footnotes.findFootnotesPlaceholder(root)
446 if result:
447 child, parent, isText = result
448 ind = list(parent).index(child)
449 if isText:
450 parent.remove(child)
451 parent.insert(ind, footnotesDiv)
452 else:
453 parent.insert(ind + 1, footnotesDiv)
454 child.tail = None
455 else:
456 root.append(footnotesDiv)
457
458
459class FootnoteReorderingProcessor(Treeprocessor):

Callers

nothing calls this directly

Calls 3

makeFootnotesDivMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected