Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
433 ddelon 1
<?php
2
// This may look a bit strange, but all possible formatting tags have to be in a single regular expression for this to work correctly. Yup!
3
 
4
if (!function_exists("wakka2callback"))
5
{
6
	function wakka2callback($things)
7
	{
8
		$thing = $things[1];
9
 
10
		global $wiki;
11
 
12
		// events
13
		if (preg_match("/^\{\{(.*?)\}\}$/s", $thing, $matches))
14
		{
15
			if ($matches[1])
16
				return $wiki->Action($matches[1]);
17
			else
18
				return "{{}}";
19
		}
20
		else if (preg_match("/^.*$/s", $thing, $matches))
21
		{
22
			return "";
23
		}
24
 
25
		// if we reach this point, it must have been an accident.
26
		return $thing;
27
	}
28
}
29
 
30
 
31
$text = str_replace("\r", "", $text);
32
$text = trim($text)."\n";
33
$text = preg_replace_callback(
34
	"/(\{\{.*?\}\}|.*)/msU", "wakka2callback", $text);
35
 
36
print($text);
37
?>