def hash_footnote_reference(text, hashes, markdown_obj):
footnotes = markdown_obj.footnotes<EOL>numbers = {f: i+<NUM_LIT:1> for i, f in enumerate(footnotes)}<EOL>def sub(match):<EOL><INDENT>footnote_id = match.group(<NUM_LIT:1>)<EOL>if footnote_id not in footnotes:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>number = numbers[footnote_id]<EOL>result = '<STR_LIT>'.format(number)<EOL>hashed = hash_text(result, '<STR_LIT>')<EOL>hashes[hashed] = result<EOL>return hashed<EOL><DEDENT>return re_footnote.sub(sub, text)<EOL>
Hashes a footnote [^id] reference

    This function converts footnote styles:

        text here[^id]

    Footnotes can be defined anywhere in the Markdown text.