class_docstr: Footnote Extension. 
class_docstr_tok: ["Footnote","Extension","."]
docstr: Add pieces to Markdown. 
docstr_tok: ["Add","pieces","to","Markdown","."]
code: def extendMarkdown(self, md):
      """Add pieces to Markdown."""
      md.registerExtension(self)
      self.parser = md.parser
      self.md = md
      # Insert a `blockprocessor` before `ReferencePreprocessor`
      md.parser.blockprocessors.register(
          FootnoteBlockProcessor(self), "footnote", 17
      )
  
      # Insert an inline pattern before `ImageReferencePattern`
      FOOTNOTE_RE = r"\[\^([^\]]*)\]"  # blah blah [^1] blah
      md.inlinePatterns.register(
          FootnoteInlineProcessor(FOOTNOTE_RE, self), "footnote", 175
      )
      # Insert a tree-processor that would actually add the footnote div
      # This must be before all other tree-processors (i.e., `inline` and
      # `codehilite`) so they can run on the the contents of the div.
      md.treeprocessors.register(
          FootnoteTreeprocessor(self), "footnote", 50
      )
  
      # Insert a tree-processor that will run after inline is done.
      # In this tree-processor we want to check our duplicate footnote tracker
      # And add additional `backrefs` to the footnote pointing back to the
      # duplicated references.
      md.treeprocessors.register(
          FootnotePostTreeprocessor(self), "footnote-duplicate", 15
      )
  
      # Insert a postprocessor after amp_substitute processor
      md.postprocessors.register(
          FootnotePostprocessor(self), "footnote", 25
      )
  
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 2 for calling the FootnoteExtension obj's underlying member method code with example usage: obj.extendMarkdown(md) without return types