Build and append footnote div to end of document.
| 405 | |
| 406 | |
| 407 | class FootnoteTreeprocessor(Treeprocessor): |
| 408 | """ Build and append footnote div to end of document. """ |
| 409 | |
| 410 | def __init__(self, footnotes: FootnoteExtension): |
| 411 | self.footnotes = footnotes |
| 412 | |
| 413 | def run(self, root: etree.Element) -> None: |
| 414 | footnotesDiv = self.footnotes.makeFootnotesDiv(root) |
| 415 | if footnotesDiv is not None: |
| 416 | result = self.footnotes.findFootnotesPlaceholder(root) |
| 417 | if result: |
| 418 | child, parent, isText = result |
| 419 | ind = list(parent).index(child) |
| 420 | if isText: |
| 421 | parent.remove(child) |
| 422 | parent.insert(ind, footnotesDiv) |
| 423 | else: |
| 424 | parent.insert(ind + 1, footnotesDiv) |
| 425 | child.tail = None |
| 426 | else: |
| 427 | root.append(footnotesDiv) |
| 428 | |
| 429 | |
| 430 | class FootnoteReorderingProcessor(Treeprocessor): |
no outgoing calls
no test coverage detected
searching dependent graphs…