docs: def get_references(text):
      """Retrieves all link references within the text.
  
      Link references can be defined anywhere in the text, and look like
      this:
  
          [id]: www.example.com "optional title"
  
      A link (either <a> or <img>) can then refer to the link reference:
  
          [this is a link][id]
  
      Link IDs are case insensitive. Link references are also removed
      from the text after they have been retrieved.
  
      RETURNS:
      text       -- str; text with all link labels removed
      references -- dict; link ids to (URL, title), where title is the
                    empty string if it is omitted.
      """
      references = {}
      for ref_id, link, _, title in re_references.findall(text):
          ref_id = re.sub(r'<(.*?)>', r'\1', ref_id).lower().strip()
          references[ref_id] = (link, title)
      text = re_references.sub('', text)
      return text, references