2", $text); // Bold $text = preg_replace("|(\\\'\\\'\\\')(.*?)(\\\'\\\'\\\')|", "2", $text); // Italic $text = preg_replace("|(\\\'\\\')(.*?)(\\\'\\\')|", "2", $text); // LINKS // Internal links with aliases $text = preg_replace("|([[)(.*?)|(.*?)(]])|", "3", $text); // Internal links without aliases $text = preg_replace("|([[)(.*?)(]])|", "2", $text); // External links with descriptions $text = preg_replace("|([)(.*?) (.*?)(])|", "3", $text); // External links with no description $count = 1; $replace = TRUE; while ($replace) { $before = $text; $text = preg_replace("|([)(.*?)(])|", "[".$count."]", $text, 1); if ($before==$text) { $replace = FALSE; } $count++; } // HEADINGS $text = preg_replace("|(======)(.*?)(======)|", "
2
", $text); $text = preg_replace("|(=====)(.*?)(=====)|", "
2
", $text); $text = preg_replace("|(====)(.*?)(====)|", "

2

", $text); $text = preg_replace("|(===)(.*?)(===)|", "

2

", $text); $text = preg_replace("|(==)(.*?)(==)|", "

2

", $text); // RETURN return $text; } add_filter('pre_post', 'bb_mediawikitext', 1); ?>