Skip to content

Commit 72ae019

Browse files
committed
Refactoring
1 parent dd0d22c commit 72ae019

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

BbCode/Math.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,24 @@
44

55
class Math
66
{
7-
private static function loadMathjax(\XF\BbCode\Renderer\AbstractRenderer $renderer)
8-
{
9-
$renderer->getTemplater()->includeJs([
10-
'src' => 'inforge/bbmath/mathjax-loader.js',
11-
'addon' => 'Inforge/BbMath',
12-
'min' => true,
13-
]);
14-
}
15-
167
public static function renderMathTag($tagChildren, $tagOption, $tag,
178
array $options, \XF\BbCode\Renderer\AbstractRenderer $renderer)
189
{
1910
$pre = '$$\[';
2011
$post = '$$\]';
21-
if (strpos($tag['tag'], 'imath') === 0) {
12+
if (strpos($tag['tag'], 'imath') !== false) {
2213
$pre = '$$\(';
2314
$post = '$$\)';
2415
}
2516
if (count($tagChildren) == 0
2617
|| !is_string($tagChildren[0])
2718
|| strlen($tagChildren[0]) == 0)
2819
return '';
29-
self::loadMathjax($renderer);
20+
$renderer->getTemplater()->includeJs([
21+
'src' => 'inforge/bbmath/mathjax-loader.js',
22+
'addon' => 'Inforge/BbMath',
23+
'min' => true,
24+
]);
3025
return $pre . $tagChildren[0] . $post;
3126
}
3227
}

0 commit comments

Comments
 (0)