Improve whitespace display from/to BBCode/HTML
This commit is contained in:
parent
a5bf37fd98
commit
96ed7525b7
2 changed files with 2 additions and 2 deletions
|
@ -348,7 +348,7 @@ class BBCode extends BaseObject
|
||||||
*/
|
*/
|
||||||
public static function toPlaintext($text, $keep_urls = true)
|
public static function toPlaintext($text, $keep_urls = true)
|
||||||
{
|
{
|
||||||
$naked_text = preg_replace('/\[(.+?)\]/','', $text);
|
$naked_text = preg_replace('/\[(.+?)\]\s*/','', $text);
|
||||||
if (!$keep_urls) {
|
if (!$keep_urls) {
|
||||||
$naked_text = preg_replace('#https?\://[^\s<]+[^\s\.\)]#i', '', $naked_text);
|
$naked_text = preg_replace('#https?\://[^\s<]+[^\s\.\)]#i', '', $naked_text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ class HTML
|
||||||
$prefix = '[code=' . $matches[1] . ']';
|
$prefix = '[code=' . $matches[1] . ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
$codeblocks[] = $prefix . trim($matches[2]) . '[/code]';
|
$codeblocks[] = $prefix . PHP_EOL . trim($matches[2]) . PHP_EOL . '[/code]';
|
||||||
return $return;
|
return $return;
|
||||||
},
|
},
|
||||||
$message
|
$message
|
||||||
|
|
Loading…
Reference in a new issue