diff -r d56a55a3011b -r c308b471ed82 includes/wikiengine/parse_mediawiki.php --- a/includes/wikiengine/parse_mediawiki.php Wed Oct 07 13:01:00 2009 -0400 +++ b/includes/wikiengine/parse_mediawiki.php Tue Oct 13 12:44:27 2009 -0400 @@ -206,7 +206,17 @@ ) ;sx"; - $text = preg_replace($regex, '<_paragraph_bypass>$0', $text); + // using preg_replace here sometimes gives us empty strings probably because we're using $0 + // in the replace formatter. so we'll just take care of it explicitly here with preg_match_all + // and good ole str_replace_once. + if ( preg_match_all($regex, $text, $matches) ) + { + foreach ( $matches[0] as $match ) + { + $text = str_replace_once($match, '<_paragraph_bypass>' . $match . '', $text); + } + } + RenderMan::tag_unstrip('_paragraph_bypass', $text, $_nw, true); // This is potentially a hack. It allows the parser to stick in <_paragraph_bypass> tags