code: public String textToHtml(final String text) {
  
  		String escaped = HtmlUtil.escapeToHtml(text);
  
  		Matcher matcher = URL_TO_HTML_HREF_PATTERN.matcher(escaped);
  		escaped = matcher.replaceAll("<a href=\"$0\">$0</a>");
  
  		matcher = NEWLINE_TO_BR_PATTERN.matcher(escaped);
  		escaped = matcher.replaceAll("<br />");
  
  	    return "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" + "\n" +
  	    		"<html><head>" + "\n" +
  	    		"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />" + "\n" +
  	    		"</head><body>" + "\n" +
  	    		escaped + "\n" +
  	    		"</body></html>" + "\n";
  	}
docs: transforms plain text into HTML by
  <ul>
  <li>escaping HTML entities
  <li>converting URLs to &lt;a href&gt; tags
  <li>converting linebreaks to &lt;br&gt;
  <li>surrounding the text with a valid HTML4 markup
  </ul>
  
  
  @param text the plain text to convert
  @return a HTMLified version of the text