File tree 2 files changed +31
-0
lines changed
2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,20 @@ function ConfigureMathJax() {
426
426
427
427
} ) ;
428
428
429
+ //
430
+ // Reset the color extension after `autoload-all`
431
+ //
432
+ if ( MathJax . AuthorConfig . extensions . indexOf ( "TeX/color.js" ) == - 1 ) {
433
+ MathJax . Hub . Register . StartupHook ( "TeX autoload-all Ready" , function ( ) {
434
+ var macros = MathJax . InputJax . TeX . Definitions . macros ;
435
+ macros . color = "Color" ;
436
+ delete macros . textcolor ;
437
+ delete macros . colorbox ;
438
+ delete macros . fcolorbox ;
439
+ delete macros . definecolor ;
440
+ } ) ;
441
+ }
442
+
429
443
//
430
444
// Start the typesetting queue when MathJax is ready
431
445
// (reseting the counters so that the initial math doesn't affect them)
Original file line number Diff line number Diff line change
1
+ var tape = require ( 'tape' ) ;
2
+ var mjAPI = require ( "../lib/main.js" ) ;
3
+ var jsdom = require ( 'jsdom' ) . jsdom ;
4
+
5
+ tape ( 'color extension should be reset' , function ( t ) {
6
+ t . plan ( 1 ) ;
7
+ mjAPI . start ( ) ;
8
+ var tex = '\\colorbox{green}{x}' ;
9
+
10
+ mjAPI . typeset ( {
11
+ math : tex ,
12
+ format : "TeX" ,
13
+ mml : true
14
+ } , function ( data ) {
15
+ t . ok ( data . errors ) ;
16
+ } ) ;
17
+ } ) ;
You can’t perform that action at this time.
0 commit comments