summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2010-11-26 01:41:35 -0800
committerSavetheinternet <savetheinternet@n0v4.com>2010-11-26 01:41:35 -0800
commita4299fe4a659fe0e22f8e11e90096f1f66c3345c (patch)
tree48b8d4f317a86f26ccea87f85a123c7cc8a4e538 /inc
parent5fd0d21d5664d54d436e26c5ff68fb8ee79a423c (diff)
Wiki markup addition and ability to disable/enable it
Diffstat (limited to 'inc')
-rw-r--r--inc/config.php2
-rw-r--r--inc/functions.php9
2 files changed, 8 insertions, 3 deletions
diff --git a/inc/config.php b/inc/config.php
index d1cbc137..d869b5d1 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -101,6 +101,8 @@
// Automatically convert things like "..." to Unicode characters ("�")
define('AUTO_UNICODE', true, true);
+ // Use some Wiki-like syntax (''em'', '''strong''', ==Heading==, etc)
+ define('WIKI_MARKUP', true, true);
// Whether to turn URLs into functional links
define('MARKUP_URLS', true, true);
define('URL_REGEX', '/' . '(https?|ftp):\/\/' . '([\w\-]+\.)+[a-zA-Z]{2,6}' . '(\/([\w\-~\.#\/?=&;:+%]+))?' . '/', true);
diff --git a/inc/functions.php b/inc/functions.php
index 0c1210e5..4e03a531 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -209,10 +209,13 @@
if(MARKUP_URLS)
$body = preg_replace(URL_REGEX, "<a href=\"$0\">$0</a>", $body);
-
$body = preg_replace("/(^|\n)([\s]+)?(&gt;)([^\n]+)?($|\n)/m", '$1$2<span class="quote">$3$4</span>$5', $body);
- $body = preg_replace("/(^|\n)==(.+?)==\n?/m", "<h2>$2</h2>", $body);
- $body = preg_replace("/'''(.+?)'''/m", "<strong>$1</strong>", $body);
+
+ if(WIKI_MARKUP) {
+ $body = preg_replace("/(^|\n)==(.+?)==\n?/m", "<h2>$2</h2>", $body);
+ $body = preg_replace("/'''(.+?)'''/m", "<strong>$1</strong>", $body);
+ $body = preg_replace("/''(.+?)''/m", "<em>$1</em>", $body);
+ }
$body = preg_replace("/\n/", '<br/>', $body);
}