code: def footnote_item(self, key, text):
          
          back = (
              '<a href="#fnref-%s" class="footnote">&#8617;</a>'
          ) % escape(key)
          text = text.rstrip()
          if text.endswith('</p>'):
              text = re.sub(r'<\/p>$', r'%s</p>' % back, text)
          else:
              text = '%s<p>%s</p>' % (text, back)
          html = '<li id="fn-%s">%s</li>\n' % (escape(key), text)
          return html
docs: Rendering a footnote item.
  
          :param key: identity key for the footnote.
          :param text: text content of the footnote.