diff options
| author | Michael Save <savetheinternet@tinyboard.org> | 2012-03-21 11:57:30 +1100 |
|---|---|---|
| committer | Michael Save <savetheinternet@tinyboard.org> | 2012-03-21 11:57:30 +1100 |
| commit | 4afd2c7cb2fe7b40f5dd662bd79125bfcfcefbe8 (patch) | |
| tree | 3a5b879c0fbfed6029cf1f85ccbee2a4c8651839 /inc/functions.php | |
| parent | 7e1ff9580def37d98a6358cfc0af56c3184a4ff0 (diff) | |
Customizable markup syntax.
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/inc/functions.php b/inc/functions.php index b999df8c..51af3332 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1440,11 +1440,12 @@ $body = utf8tohtml($body); - if($config['wiki_markup']) { - $body = preg_replace("/(^|\n)==(.+?)==\n?/m", "<span class=\"heading\">$2</span>", $body); - $body = preg_replace("/'''(.+?)'''/m", "<strong>$1</strong>", $body); - $body = preg_replace("/''(.+?)''/m", "<em>$1</em>", $body); - $body = preg_replace("/\*\*(.+?)\*\*/m", "<span class=\"spoiler\">$1</span>", $body); + foreach($config['markup'] as $markup) { + if(is_string($markup[1])) { + $body = preg_replace($markup[0], $markup[1], $body); + } elseif(is_callable($markup[1])) { + $body = preg_replace_callback($markup[0], $markup[1], $body); + } } if($config['markup_urls']) { |
