/** * Convert all URLs and E-mail addresses in a string into hyperlinks. * * @param text The block of text to hyperlink. * @return the text with known uri formats hyperlinked * * @see #hyperlink(String, String) */ public final static String hyperlink(String text) { return hyperlink(text, null); }
/** * Convert all URLs and E-mail addresses in a string into hyperlinks. * * @param text The block of text to hyperlink. * @return the text with known uri formats hyperlinked * * @see #hyperlink(String, String) */ public final static String hyperlink(String text) { return hyperlink(text, null); }
/** * Converts plain text to html code. * * <ul> * <li>escapes appropriate characters * <li>puts in line breaks * <li>hyperlinks link and email addresses * </ul> * * @param str - String containing the plain text. * @param target - Target for href tags (optional). * @param encodeSpecialChars - if true high characters will be encode other wise not. * @return the escaped string */ public final static String plainTextToHtml(String str, String target, boolean encodeSpecialChars) { str = noNull(str); //First, convert all the special chars... str = htmlEncode(str, encodeSpecialChars); //Convert all leading whitespaces str = leadingSpaces(str); //Then convert all line breaks... str = br(str); //Then create hyperlinks... str = hyperlink(str, target); return str; }
/** * Converts plain text to html code. * * <ul> * <li>escapes appropriate characters * <li>puts in line breaks * <li>hyperlinks link and email addresses * </ul> * * @param str - String containing the plain text. * @param target - Target for href tags (optional). * @param encodeSpecialChars - if true high characters will be encode other wise not. * @return the escaped string */ public final static String plainTextToHtml(String str, String target, boolean encodeSpecialChars) { str = noNull(str); //First, convert all the special chars... str = htmlEncode(str, encodeSpecialChars); //Convert all leading whitespaces str = leadingSpaces(str); //Then convert all line breaks... str = br(str); //Then create hyperlinks... str = hyperlink(str, target); return str; }