Wordwrapping BEFORE applying bbcode breaks long links
Wordwrapping AFTER breaks the HTML generated by bbcode when using PHP's wordwrap(), better not to hard wordwrap at all and just do it with CSS
This commit is contained in:
@ -25,10 +25,6 @@
|
||||
|
||||
class BBCode extends FormatterExtension {
|
||||
public function format(/*string*/ $text) {
|
||||
global $config;
|
||||
if($config->get_bool("word_wrap", true)) {
|
||||
$text = wordwrap($text, 80, " ", true);
|
||||
}
|
||||
$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);
|
||||
@ -75,10 +71,6 @@ class BBCode extends FormatterExtension {
|
||||
}
|
||||
|
||||
public function strip(/*string*/ $text) {
|
||||
global $config;
|
||||
if($config->get_bool("word_wrap", true)) {
|
||||
$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);
|
||||
|
Reference in New Issue
Block a user