protected void appendLink(String text) {
    String[] link=split(text, '|');
    URI uri=null;
    try { // validate URI
      uri=new URI(link[0].trim());
    }
    catch (URISyntaxException e) {
    }
    if (uri!=null && uri.isAbsolute() && !uri.isOpaque()) {
      sb.append("<a href=\""+escapeHTML(uri.toString())+"\" rel=\"nofollow\">");
      sb.append(escapeHTML(unescapeHTML(link.length>=2 && !isEmpty(link[1].trim())? link[1]:link[0])));
      sb.append("</a>");
    }
    else {
      sb.append("<a href=\"#\" title=\"Internal link\">");
      sb.append(escapeHTML(unescapeHTML(link.length>=2 && !isEmpty(link[1].trim())? link[1]:link[0])));
      sb.append("</a>");
    }
  }