code: def prompt_and_select_link(self):
          
          data = self.get_selected_item()
          url_full = data.get('url_full')
          permalink = data.get('permalink')
  
          if url_full and url_full != permalink:
              # The item is a link-only submission that won't contain text
              link = url_full
          else:
              html = data.get('html')
              if html:
                  extracted_links = self.content.extract_links(html)
                  if not extracted_links:
                      # Only one selection to choose from, so just pick it
                      link = permalink
                  else:
                      # Let the user decide which link to open
                      links = []
                      if permalink:
                          links += [{'text': 'Permalink', 'href': permalink}]
                      links += extracted_links
                      link = self.term.prompt_user_to_select_link(links)
              else:
                  # Some items like hidden comments don't have any HTML to parse
                  link = permalink
  
          return link
docs: Prompt the user to select a link from a list to open.
  
          Return the link that was selected, or ``None`` if no link was selected.