diff -r 7f621a3a9cbf -r 67a4c839c7e1 includes/wikiengine/parse_mediawiki.php --- a/includes/wikiengine/parse_mediawiki.php Sun Aug 09 01:26:57 2009 -0400 +++ b/includes/wikiengine/parse_mediawiki.php Sun Aug 09 01:27:45 2009 -0400 @@ -22,6 +22,8 @@ 'externalnotext' => '#\[((?:https?|irc|ftp)://.+?)\]#' ); + private $blockquote_rand_id; + public function lang(&$text) { global $lang; @@ -152,15 +154,24 @@ public function blockquote(&$text) { - if ( !preg_match_all('/^(?:(>+) *.+(?:\r?\n|$))+/m', $text, $quotes) ) - return array(); - - $pieces = array(); - foreach ( $quotes[0] as $quote ) - $pieces[] = "\t" . trim(preg_replace('/^>+ */m', "\t", $quote)); + $rand_id = hexencode(AESCrypt::randkey(16), '', ''); - $text = Carpenter::tokenize($text, $quotes[0]); - return $pieces; + while ( preg_match_all('/^(?:(>+) *.+(?:\r?\n|$))+/m', $text, $quotes) ) + { + foreach ( $quotes[0] as $quote ) + { + $piece = trim(preg_replace('/^> */m', '', $quote)); + $text = str_replace_once($quote, "{blockquote:$rand_id}\n$piece\n{/blockquote:$rand_id}\n", $text); + } + } + //die('
' . htmlspecialchars($text) . ''); + + $this->blockquote_rand_id = $rand_id; + } + + public function blockquotepost(&$text) + { + return $this->blockquote_rand_id; } public function paragraph(&$text)