X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FText%2FMarkdown.php;h=905860647f0f83a9bb17c13f2e3d2b6a1338c29e;hb=174052eaf0ea75c31fee631c64ddb0e666c11b8e;hp=a5ba08ba3271466f503126a139523572fbcca286;hpb=38a5358bfa646ae13a4a1a385741890fa88d9b7f;p=friendica.git diff --git a/src/Content/Text/Markdown.php b/src/Content/Text/Markdown.php index a5ba08ba32..905860647f 100644 --- a/src/Content/Text/Markdown.php +++ b/src/Content/Text/Markdown.php @@ -21,7 +21,6 @@ namespace Friendica\Content\Text; -use Friendica\Core\System; use Friendica\DI; use Friendica\Model\Contact; @@ -40,7 +39,7 @@ class Markdown * @return string */ public static function convert($text, $hardwrap = true, $baseuri = null) { - $stamp1 = microtime(true); + DI::profiler()->startRecording('rendering'); $MarkdownParser = new MarkdownParser(); $MarkdownParser->code_class_prefix = 'language-'; @@ -57,7 +56,7 @@ class Markdown $html = $MarkdownParser->transform($text); - DI::profiler()->saveTimestamp($stamp1, "parser"); + DI::profiler()->stopRecording(); return $html; } @@ -109,6 +108,8 @@ class Markdown */ public static function toBBCode($s) { + DI::profiler()->startRecording('rendering'); + // The parser cannot handle paragraphs correctly $s = str_replace(['

', '

', '

'], ['
', '
', '
'], $s); @@ -134,6 +135,7 @@ class Markdown // Don't show link to full picture (until it is fixed) $s = BBCode::scaleExternalImages($s); + DI::profiler()->stopRecording(); return $s; } }