namespace Friendica\Content\Text;
-use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Contact;
* @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-';
$html = $MarkdownParser->transform($text);
- DI::profiler()->saveTimestamp($stamp1, "parser");
+ DI::profiler()->stopRecording();
return $html;
}
*/
public static function toBBCode($s)
{
+ DI::profiler()->startRecording('rendering');
+
// The parser cannot handle paragraphs correctly
$s = str_replace(['</p>', '<p>', '<p dir="ltr">'], ['<br>', '<br>', '<br>'], $s);
// Don't show link to full picture (until it is fixed)
$s = BBCode::scaleExternalImages($s);
+ DI::profiler()->stopRecording();
return $s;
}
}