Wikitext parer: re-added the <code> tag thing
authorDan
Fri, 18 Dec 2009 09:39:18 -0500
changeset 1174 def792dd9b1b
parent 1173 b5b8e7ab0914
child 1175 1e2c9819ede3
Wikitext parer: re-added the <code> tag thing
includes/wikiengine/parse_mediawiki.php
includes/wikiengine/render_xhtml.php
includes/wikiformat.php
--- 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',