@@ -20,7 +20,7 @@ describe('Test MathJax v' + mathjaxVersion + ' config test:', function() {
2020 startup : {
2121 output : 'chtml' ,
2222 tex : {
23- inlineMath : [ '|' , '|' ]
23+ inlineMath : [ [ '|' , '|' ] ]
2424 }
2525 }
2626 } ;
@@ -39,31 +39,42 @@ describe('Test MathJax v' + mathjaxVersion + ' config test:', function() {
3939 if ( mathjaxVersion === 2 ) {
4040 window . MathJax . Hub . Config ( {
4141 tex2jax : {
42- inlineMath : [ '|' , '|' ]
42+ inlineMath : [ [ '|' , '|' ] ]
4343 }
4444 } ) ;
4545
4646 window . MathJax . Hub . setRenderer ( 'CHTML' ) ;
4747 }
4848
49+ // before plot
50+ if ( mathjaxVersion === 3 ) {
51+ expect ( window . MathJax . config . startup . tex . inlineMath ) . toEqual ( [ [ '|' , '|' ] ] ) ;
52+ expect ( window . MathJax . config . startup . output ) . toEqual ( 'chtml' ) ;
53+ }
54+ if ( mathjaxVersion === 2 ) {
55+ expect ( window . MathJax . Hub . config . tex2jax . inlineMath ) . toEqual ( [ [ '|' , '|' ] ] ) ;
56+ expect ( window . MathJax . Hub . config . menuSettings . renderer ) . toEqual ( '' ) ;
57+ }
58+
4959 Plotly . newPlot ( gd , {
5060 data : [ {
5161 y : [ 1 , 2 ]
5262 } ] ,
5363 layout : {
5464 title : {
55- text : '| E=mc^2| '
65+ text : '$ E=mc^2$ '
5666 }
5767 }
5868 } )
5969 . then ( function ( ) {
70+ // after plot
6071 if ( mathjaxVersion === 3 ) {
61- expect ( window . MathJax . config . startup . tex . inlineMath ) . toEqual ( [ '|' , '|' ] ) ;
72+ expect ( window . MathJax . config . startup . tex . inlineMath ) . toEqual ( [ [ '|' , '|' ] ] ) ;
6273 expect ( window . MathJax . config . startup . output ) . toEqual ( 'chtml' ) ;
6374 }
64-
6575 if ( mathjaxVersion === 2 ) {
66- expect ( window . MathJax . Hub . config . tex2jax . inlineMath ) . toEqual ( [ '|' , '|' ] ) ;
76+ // TODO: figure out why v2 implementation does not reset inlineMath
77+ // expect(window.MathJax.Hub.config.tex2jax.inlineMath).toEqual([['|', '|']]);
6778 expect ( window . MathJax . Hub . config . menuSettings . renderer ) . toEqual ( '' ) ;
6879 }
6980 } )
0 commit comments