(self, md, md_globals)
Add pieces to Markdown.
Add pieces to Markdown.
Add pieces to Markdown .
def extendMarkdown(self, md, md_globals):
        """ Add pieces to Markdown. """
        md.registerExtension(self)
        self.parser = md.parser
        # Insert a preprocessor before ReferencePreprocessor
        md.preprocessors.add("footnote", FootnotePreprocessor(self),
                             "<reference")
        # Insert an inline pattern before ImageReferencePattern
        FOOTNOTE_RE = r'\[\^([^\]]*)\]' # blah blah [^1] blah
        md.inlinePatterns.add("footnote", FootnotePattern(FOOTNOTE_RE, self),
                              "<reference")
        # Insert a tree-processor that would actually add the footnote div
        # This must be before all other treeprocessors (i.e., inline and 
        # codehilite) so they can run on the the contents of the div.
        md.treeprocessors.add("footnote", FootnoteTreeprocessor(self),
                                 "_begin")
        # Insert a postprocessor after amp_substitute oricessor
        md.postprocessors.add("footnote", FootnotePostprocessor(self),
                                  ">amp_substitute")
def extendMarkdown ( self , md , md_globals ) : md . registerExtension ( self ) self . parser = md . parser # Insert a preprocessor before ReferencePreprocessor md . preprocessors . add ( "footnote" , FootnotePreprocessor ( self ) , "<reference" ) # Insert an inline pattern before ImageReferencePattern FOOTNOTE_RE = r'\[\^([^\]]*)\]' # blah blah [^1] blah md . inlinePatterns . add ( "footnote" , FootnotePattern ( FOOTNOTE_RE , self ) , "<reference" ) # Insert a tree-processor that would actually add the footnote div # This must be before all other treeprocessors (i.e., inline and  # codehilite) so they can run on the the contents of the div. md . treeprocessors . add ( "footnote" , FootnoteTreeprocessor ( self ) , "_begin" ) # Insert a postprocessor after amp_substitute oricessor md . postprocessors . add ( "footnote" , FootnotePostprocessor ( self ) , ">amp_substitute" )