docs: def linkify_url(value):
      """Tranform an URL pulled from the database to a safe HTML fragment."""
  
      value = value.strip()
  
      rjs = r"[\s]*(&#x.{1,7})?".join(list("javascript:"))
      rvb = r"[\s]*(&#x.{1,7})?".join(list("vbscript:"))
      re_scripts = re.compile(f"({rjs})|({rvb})", re.IGNORECASE)
  
      value = re_scripts.sub("", value)
  
      url = value
      if not url.startswith("http://") and not url.startswith("https://"):
          url = "http://" + url
  
      url = parse.urlsplit(url).geturl()
      if '"' in url:
          url = url.split('"')[0]
      if "<" in url:
          url = url.split("<")[0]
  
      if value.startswith("http://"):
          value = value[len("http://") :]
      elif value.startswith("https://"):
          value = value[len("https://") :]
  
      if value.count("/") == 1 and value.endswith("/"):
          value = value[0:-1]
  
      return '<a href="{}">{}</a>&nbsp;<i class="fa fa-external-link"></i>'.format(
          url, value
      )