--- a/includes/wikiengine/parse_mediawiki.php Fri Dec 18 05:12:02 2009 -0500
+++ b/includes/wikiengine/parse_mediawiki.php Fri Dec 18 09:39:18 2009 -0500
@@ -21,7 +21,8 @@
'externalnotext' => '#\[((?:https?|irc|ftp)://.+?)\]#',
'mailtonotext' => '#\[mailto:([^ \]]+?)\]#',
'mailtowithtext' => '#\[mailto:([^ \]]+?) (.+?)\]#',
- 'hr' => '/^[-]{4,} *$/m'
+ 'hr' => '/^[-]{4,} *$/m',
+ 'code' => '/^<code>(?:\r?\n)?(.+?)(?:\r?\n)?<\/code>$/mis'
);
private $blockquote_rand_id;
--- a/includes/wikiengine/render_xhtml.php Fri Dec 18 05:12:02 2009 -0500
+++ b/includes/wikiengine/render_xhtml.php Fri Dec 18 09:39:18 2009 -0500
@@ -156,6 +156,11 @@
global $email;
return $email->encryptEmail($pieces[1], '', '', $pieces[2]);
}
+
+ public function code($match)
+ {
+ return '<pre>' . htmlspecialchars($match[0]) . '</pre>';
+ }
}
// Alias internal link parsing to RenderMan's method
--- a/includes/wikiformat.php Fri Dec 18 05:12:02 2009 -0500
+++ b/includes/wikiformat.php Fri Dec 18 09:39:18 2009 -0500
@@ -60,6 +60,7 @@
'lang',
'templates',
'blockquote',
+ 'code',
'tables',
'heading',
'hr',