(self, root)
| 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 | |
| 297 | class FootnotePostprocessor(markdown.postprocessors.Postprocessor): |
| 298 | """ Replace placeholders with html entities. """ |
nothing calls this directly
no test coverage detected