X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FText%2FBBCode.php;h=c3453bcf727bda8baf6f51517838e4403e7d43a6;hb=406b46b63531bb45d73eda3badc7ba657c1ab8c0;hp=b403b1f349e1a8a0ef8a04346790a29f75840cd1;hpb=ba4f368b451144230af4e7a604113cf1e1d17717;p=friendica.git diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index b403b1f349..c3453bcf72 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -25,7 +25,6 @@ use Friendica\Util\Map; use Friendica\Util\Network; use Friendica\Util\ParseUrl; use Friendica\Util\Proxy as ProxyUtils; -use League\HTMLToMarkdown\HtmlConverter; class BBCode extends BaseObject { @@ -348,7 +347,7 @@ class BBCode extends BaseObject */ public static function toPlaintext($text, $keep_urls = true) { - $naked_text = preg_replace('/\[(.+?)\]/','', $text); + $naked_text = preg_replace('/\[(.+?)\]\s*/','', $text); if (!$keep_urls) { $naked_text = preg_replace('#https?\://[^\s<]+[^\s\.\)]#i', '', $naked_text); } @@ -1942,8 +1941,7 @@ class BBCode extends BaseObject $stamp1 = microtime(true); // Now convert HTML to Markdown - $converter = new HtmlConverter(); - $text = $converter->convert($text); + $text = HTML::toMarkdown($text); // unmask the special chars back to HTML $text = str_replace(['&\_lt\_;', '&\_gt\_;', '&\_amp\_;'], ['<', '>', '&'], $text);