![]()
');
// bold, italic, underline, and strikethrough
// These are worse than sed. Not only do you have to escape stuff, you have to
// escape it again for PHP.
$text = preg_replace('/(?\1', $text);
$text = preg_replace('/%\*\*/', '**', $text);
$text = preg_replace('/(?\1', $text);
$text = preg_replace('/(\\\\)\/\//', '//', $text);
$text = preg_replace('/(?\1', $text);
$text = preg_replace('/(\\\\)__/', '__', $text);
$text = preg_replace('/(?\1', $text);
$text = preg_replace('/(\\\\)--/', '--', $text);
// lists
$text = preg_replace_callback('/\[(end)?(#)?list\]/m', 'make_list', $text);
$text = preg_replace_callback('/(\s*)\*(.+)$/smU', 'make_li', $text);
// external links
$text = convert_urls($text);
// links to wiki pages
$text = preg_replace_callback('/(?', $text);
// headers
$text = preg_replace_callback('/(?', $text);
$text = str_replace('
', '', $text);
// code blocks
$text = preg_replace_callback('/\[code=(.+)\](.+)\[endcode\]/smU', 'code_block', $text);
$text = preg_replace_callback('/~~(.*)~~/sU', 'get_tag', $text);
return $text;
}
?>