public String markdown(String txt) {
        if (txt == null) {
            txt = "";
        }
        TextEditor text = new TextEditor(txt);

        // Standardize line endings:
        text.replaceAll("\\r\\n", "\n"); 	// DOS to Unix
        text.replaceAll("\\r", "\n");    	// Mac to Unix
        text.replaceAll("^[ \\t]+$", "");

        // Make sure $text ends with a couple of newlines:
        text.append("\n\n");

        text.detabify();
        text.deleteAll("^[ ]+$");
        hashHTMLBlocks(text);
        stripLinkDefinitions(text);
        text = runBlockGamut(text);
        unEscapeSpecialChars(text);

        text.append("\n");
        return text.toString();
    }
public String markdown(String txt) {
        if (txt == null) {
            txt = "";
        }
        TextEditor text = new TextEditor(txt);

        
        text.replaceAll("\\r\\n", "\n"); 	
        text.replaceAll("\\r", "\n");    	
        text.replaceAll("^[ \\t]+$", "");

        
        text.append("\n\n");

        text.detabify();
        text.deleteAll("^[ ]+$");
        hashHTMLBlocks(text);
        stripLinkDefinitions(text);
        text = runBlockGamut(text);
        unEscapeSpecialChars(text);

        text.append("\n");
        return text.toString();
    }
public String markdown ( String txt ) { if ( txt == null ) { txt = "" ; } TextEditor text = new TextEditor ( txt ) ; // Standardize line endings: text . replaceAll ( "\\r\\n" , "\n" ) ; // DOS to Unix text . replaceAll ( "\\r" , "\n" ) ; // Mac to Unix text . replaceAll ( "^[ \\t]+$" , "" ) ; // Make sure $text ends with a couple of newlines: text . append ( "\n\n" ) ; text . detabify ( ) ; text . deleteAll ( "^[ ]+$" ) ; hashHTMLBlocks ( text ) ; stripLinkDefinitions ( text ) ; text = runBlockGamut ( text ) ; unEscapeSpecialChars ( text ) ; text . append ( "\n" ) ; return text . toString ( ) ; }
Perform the conversion from Markdown to HTML.

@param txt - input in markdown format
@return HTML block corresponding to txt passed in.
Perform the conversion from Markdown to HTML .