class_docstr: Footnote Extension. 
class_docstr_tok: ["Footnote","Extension","."]
docstr: Return `div` of footnotes as `etree` Element. 
docstr_tok: ["Return","`","div","`","of","footnotes","as","`","etree","`","Element","."]
code: def makeFootnotesDiv(
      self, root: etree.Element
  ) -> etree.Element | None:
      """Return `div` of footnotes as `etree` Element."""
  
      if not list(self.footnotes.keys()):
          return None
  
      div = etree.Element("div")
      div.set("class", "footnote")
      etree.SubElement(div, "hr")
      ol = etree.SubElement(div, "ol")
      surrogate_parent = etree.Element("div")
  
      # Backward compatibility with old '%d' placeholder
      backlink_title = self.getConfig("BACKLINK_TITLE").replace(
          "%d", "{}"
      )
  
      for index, id in enumerate(self.footnotes.keys(), start=1):
          li = etree.SubElement(ol, "li")
          li.set("id", self.makeFootnoteId(id))
          # Parse footnote with surrogate parent as `li` cannot be used.
          # List block handlers have special logic to deal with `li`.
          # When we are done parsing, we will copy everything over to `li`.
          self.parser.parseChunk(surrogate_parent, self.footnotes[id])
          for el in list(surrogate_parent):
              li.append(el)
              surrogate_parent.remove(el)
          backlink = etree.Element("a")
          backlink.set("href", "#" + self.makeFootnoteRefId(id))
          backlink.set("class", "footnote-backref")
          backlink.set("title", backlink_title.format(index))
          backlink.text = FN_BACKLINK_TEXT
  
          if len(li):
              node = li[-1]
              if node.tag == "p":
                  node.text = node.text + NBSP_PLACEHOLDER
                  node.append(backlink)
              else:
                  p = etree.SubElement(li, "p")
                  p.append(backlink)
      return div
  
imports: from __future__ import annotations
  from .None import Extension
  from ..blockprocessors import BlockProcessor
  from ..inlinepatterns import InlineProcessor
  from ..treeprocessors import Treeprocessor
  from ..postprocessors import Postprocessor
  from ..None import util
  from collections import OrderedDict
  import re
  import copy
  import xml.etree.ElementTree
label_desc: Use image node_id 10 for calling the FootnoteExtension obj's underlying member method code with example usage: obj.makeFootnotesDiv(root) and returns: div, None