X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FText%2FHTML.php;h=0e117a2205b9a7676897dd9f15e2f9a35a61d69a;hb=865006682a3952565035207898b80dfbd6d390b1;hp=51515137e56ddd00f3d576e93f4998b7652bf025;hpb=2bda6980bbd36ef011e6c19502ea2a0fe3376d02;p=friendica.git diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index 51515137e5..0e117a2205 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -143,6 +143,7 @@ class HTML */ public static function toBBCode($message, $basepath = '') { + DI::profiler()->startRecording('rendering'); $message = str_replace("\r", "", $message); $message = Strings::performWithEscapedBlocks($message, '#
#iUs', function ($message) { @@ -396,6 +397,7 @@ class HTML $message = self::qualifyURLs($message, $basepath); } + DI::profiler()->stopRecording(); return $message; } @@ -585,6 +587,7 @@ class HTML */ public static function toPlaintext(string $html, $wraplength = 75, $compact = false) { + DI::profiler()->startRecording('rendering'); $message = str_replace("\r", "", $html); $doc = new DOMDocument(); @@ -593,6 +596,7 @@ class HTML $message = mb_convert_encoding($message, 'HTML-ENTITIES', "UTF-8"); if (empty($message)) { + DI::profiler()->stopRecording(); return ''; } @@ -606,6 +610,7 @@ class HTML $urls = self::collectURLs($message); if (empty($message)) { + DI::profiler()->stopRecording(); return ''; } @@ -689,6 +694,7 @@ class HTML $message = self::quoteLevel(trim($message), $wraplength); + DI::profiler()->stopRecording(); return trim($message); } @@ -701,9 +707,11 @@ class HTML */ public static function toMarkdown($html) { + DI::profiler()->startRecording('rendering'); $converter = new HtmlConverter(['hard_break' => true]); $markdown = $converter->convert($html); + DI::profiler()->stopRecording(); return $markdown; } @@ -801,22 +809,6 @@ class HTML ]); } - /** - * Get html for contact block. - * - * @deprecated since version 2019.03 - * @see ContactBlock::getHTML() - * @return string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - * @throws \ImagickException - */ - public static function contactBlock() - { - $a = DI::app(); - - return ContactBlock::getHTML($a->profile); - } - /** * Format contacts as picture links or as text links *