diff --git a/ext/bbcode/main.php b/ext/bbcode/main.php
index ae4b9ca8..b6984af6 100644
--- a/ext/bbcode/main.php
+++ b/ext/bbcode/main.php
@@ -2,6 +2,7 @@
class BBCode extends FormatterExtension {
public function format($text) {
+ $text = wordwrap($text, 80, " ", true);
$text = $this->extract_code($text);
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text);
@@ -36,6 +37,7 @@ class BBCode extends FormatterExtension {
}
public function strip($text) {
+ $text = wordwrap($text, 80, " ", true);
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text);
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "\\1", $text);