|
|
@ -52,6 +52,13 @@ class AppExtension extends AbstractExtension |
|
|
|
'mentionToMarkdown' |
|
|
|
'mentionToMarkdown' |
|
|
|
] |
|
|
|
] |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
new TwigFilter( |
|
|
|
|
|
|
|
'namespace_to_markdown', |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
$this, |
|
|
|
|
|
|
|
'namespaceToMarkdown' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
), |
|
|
|
new TwigFilter( |
|
|
|
new TwigFilter( |
|
|
|
'keva_namespace_value', |
|
|
|
'keva_namespace_value', |
|
|
|
[ |
|
|
|
[ |
|
|
@ -145,6 +152,10 @@ class AppExtension extends AbstractExtension |
|
|
|
$text |
|
|
|
$text |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$text = $this->namespaceToMarkdown( |
|
|
|
|
|
|
|
$text |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return $text; |
|
|
|
return $text; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -170,6 +181,17 @@ class AppExtension extends AbstractExtension |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function namespaceToMarkdown( |
|
|
|
|
|
|
|
string $text |
|
|
|
|
|
|
|
): string |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return preg_replace( |
|
|
|
|
|
|
|
'~(N[A-z0-9]{33})~i', |
|
|
|
|
|
|
|
'[$1]($1)', |
|
|
|
|
|
|
|
$text |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private function plural(int $number, array $texts) |
|
|
|
private function plural(int $number, array $texts) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$cases = [2, 0, 1, 1, 1, 2]; |
|
|
|
$cases = [2, 0, 1, 1, 1, 2]; |
|
|
|