mirror of
https://github.com/friendica/friendica
synced 2025-04-26 01:50:11 +00:00
Support for stacked profiler analysis
This commit is contained in:
parent
3cef3ab107
commit
c89533a70b
17 changed files with 763 additions and 611 deletions
|
@ -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(['</p>', '<p>', '<p dir="ltr">'], ['<br>', '<br>', '<br>'], $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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue