File tree 1 file changed +6
-11
lines changed
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 4
4
5
5
class Math
6
6
{
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
-
16
7
public static function renderMathTag ($ tagChildren , $ tagOption , $ tag ,
17
8
array $ options , \XF \BbCode \Renderer \AbstractRenderer $ renderer )
18
9
{
19
10
$ pre = '$$\[ ' ;
20
11
$ post = '$$\] ' ;
21
- if (strpos ($ tag ['tag ' ], 'imath ' ) === 0 ) {
12
+ if (strpos ($ tag ['tag ' ], 'imath ' ) !== false ) {
22
13
$ pre = '$$\( ' ;
23
14
$ post = '$$\) ' ;
24
15
}
25
16
if (count ($ tagChildren ) == 0
26
17
|| !is_string ($ tagChildren [0 ])
27
18
|| strlen ($ tagChildren [0 ]) == 0 )
28
19
return '' ;
29
- self ::loadMathjax ($ renderer );
20
+ $ renderer ->getTemplater ()->includeJs ([
21
+ 'src ' => 'inforge/bbmath/mathjax-loader.js ' ,
22
+ 'addon ' => 'Inforge/BbMath ' ,
23
+ 'min ' => true ,
24
+ ]);
30
25
return $ pre . $ tagChildren [0 ] . $ post ;
31
26
}
32
27
}
You can’t perform that action at this time.
0 commit comments