with no more wordwrap, there's no need for unwrap

This commit is contained in:
Shish 2012-03-13 16:01:03 +00:00
parent d11dad3055
commit c887580074

View file

@ -27,10 +27,6 @@
class BBCode extends FormatterExtension {
public function format(/*string*/ $text) {
$text = preg_replace_callback("/(\[img\]https?:\/\/.*?\[\/img\])/s", array($this, "unwrap"), $text);
$text = preg_replace_callback("/(\[url=(?:https?|ftp|irc|mailto):\/\/.*?\])/s", array($this, "unwrap"), $text);
$text = preg_replace_callback("/(\[url\](?:https?|ftp|irc|mailto):\/\/.*?\[\/url\])/s", array($this, "unwrap"), $text);
$text = $this->extract_code($text);
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "<b>\\1</b>", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
@ -70,10 +66,6 @@ class BBCode extends FormatterExtension {
return $text;
}
private function unwrap($matches) {
return str_replace(' ', '', $matches[1]);
}
public function strip(/*string*/ $text) {
$text = preg_replace("/\[b\](.*?)\[\/b\]/s", "\\1", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "\\1", $text);