function textile($text, $lite = '')
{
    if (get_magic_quotes_gpc() == 1) {
        $text = stripslashes($text);
    }
    $text = incomingEntities($text);
    $text = encodeSpecial($text);
    $text = encodeEntities($text);
    $text = fixEntities($text);
    $text = cleanWhiteSpace($text);
    $text = getRefs($text);
    $text = noTextile($text);
    $text = image($text);
    $text = links($text);
    $text = code($text);
    $text = span($text);
    $text = superscript($text);
    $text = footnoteRef($text);
    $text = glyphs($text);
    $text = retrieve($text);
    if ($lite == '') {
        $text = lists($text);
        $text = table($text);
        $text = block($text);
    }
    /* clean up <notextile> */
    $text = preg_replace('/<\\/?notextile>/', "", $text);
    /* turn the temp char back to an ampersand entity */
    $text = str_replace("x%x%", "&#38;", $text);
    $text = str_replace("<br />", "<br />\n", $text);
    return trim($text);
}
Ejemplo n.º 2
0
<?