Wikitext parser: re-added mailto support
authorDan
Fri, 11 Dec 2009 17:10:44 -0500
changeset 1156 417e66a664d0
parent 1155 a1770361ef88
child 1157 e154e8176700
Wikitext parser: re-added mailto support
includes/wikiengine/parse_mediawiki.php
includes/wikiengine/render_xhtml.php
includes/wikiformat.php
--- a/includes/wikiengine/parse_mediawiki.php	Mon Dec 07 15:21:47 2009 -0500
+++ b/includes/wikiengine/parse_mediawiki.php	Fri Dec 11 17:10:44 2009 -0500
@@ -19,6 +19,8 @@
     'underline' => '/__(.+?)__/',
     'externalwithtext' => '#\[((?:https?|irc|ftp)://.+?) (.+?)\]#',
     'externalnotext' => '#\[((?:https?|irc|ftp)://.+?)\]#',
+    'mailtonotext' => '#\[mailto:([^ \]]+?)\]#',
+    'mailtowithtext' => '#\[mailto:([^ \]]+?) (.+?)\]#',
     'hr' => '/^[-]{4,} *$/m'
   );
   
--- a/includes/wikiengine/render_xhtml.php	Mon Dec 07 15:21:47 2009 -0500
+++ b/includes/wikiengine/render_xhtml.php	Fri Dec 11 17:10:44 2009 -0500
@@ -144,6 +144,18 @@
     
     return $text;
   }
+  
+  public function mailtonotext($pieces)
+  {
+    $pieces[2] = $pieces[1];
+    return $this->mailtowithtext($pieces);
+  }
+  
+  public function mailtowithtext($pieces)
+  {
+    global $email;
+    return $email->encryptEmail($pieces[1], '', '', $pieces[2]);
+  }
 }
 
 // Alias internal link parsing to RenderMan's method
--- a/includes/wikiformat.php	Mon Dec 07 15:21:47 2009 -0500
+++ b/includes/wikiformat.php	Fri Dec 11 17:10:44 2009 -0500
@@ -70,6 +70,8 @@
       'underline',
       'externalwithtext',
       'externalnotext',
+      'mailtowithtext',
+      'mailtonotext',
       'image',
       'internallink',
       'paragraph',