summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/config.php3
-rw-r--r--inc/functions.php3
2 files changed, 6 insertions, 0 deletions
diff --git a/inc/config.php b/inc/config.php
index abfc38e3..d5999b0a 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -128,6 +128,9 @@
// Reply limit (deletes thread when this is reached)
$config['reply_limit'] = 250;
+ // Strip superfluous new lines at the end of a post
+ $config['strip_superfluous_returns'] = true;
+
// For resizing, max values
$config['thumb_width'] = 255;
$config['thumb_height'] = 255;
diff --git a/inc/functions.php b/inc/functions.php
index 6e709d9b..0fa20fc3 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -905,6 +905,9 @@
$body = preg_replace("/''(.+?)''/m", "<em>$1</em>", $body);
$body = preg_replace("/\*\*(.+?)\*\*/m", "<span class=\"spoiler\">$1</span>", $body);
}
+ if($config['strip_superfluous_returns'])
+ $body = preg_replace('/\s+$/', '', $body);
+
$body = preg_replace("/\n/", '<br/>', $body);
}