File tree Expand file tree Collapse file tree 3 files changed +36
-5
lines changed
Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ The `config` method is used to set _global_ configuration options. Its default o
8383 displayErrors: true , // determines whether error messages are shown on the console
8484 undefinedCharError: false , // determines whether "unknown characters" (i.e., no glyph in the configured fonts) are saved in the error array
8585 extensions: ' ' , // a convenience option to add MathJax extensions
86- fontURL: ' https://cdn.mathjax.org/ mathjax/latest /fonts/HTML-CSS' , // for webfont urls in the CSS for HTML output
86+ fontURL: ' https://cdnjs.cloudflare.com/ajax/libs/ mathjax/2.7.0 /fonts/HTML-CSS' , // for webfont urls in the CSS for HTML output
8787 MathJax: { } // standard MathJax configuration options, see https://docs.mathjax.org for more detail.
8888}
8989```
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ var displayMessages = false; // don't log Message.Set() calls
3838var displayErrors = true ; // show error messages on the console
3939var undefinedChar = false ; // unknown characters are not saved in the error array
4040var extensions = '' ; // no additional extensions used
41- var fontURL = 'https://cdn.mathjax.org/ mathjax/latest /fonts/HTML-CSS' ; // location of web fonts for CHTML
41+ var fontURL = 'https://cdnjs.cloudflare.com/ajax/libs/ mathjax/2.7.0 /fonts/HTML-CSS' ; // location of web fonts for CHTML
4242
4343var defaults = {
4444 ex : 6 , // ex-size in pixels
@@ -773,9 +773,9 @@ function ReturnResult(result) {
773773 state . n = GLYPH . n ;
774774 state . ID = ID ;
775775 }
776- callback ( result , data ) ;
777776 serverState = STATE . READY ;
778- StartQueue ( ) ;
777+ callback ( result , data ) ;
778+ if ( serverState === STATE . READY ) StartQueue ( ) ;
779779}
780780
781781//
@@ -809,8 +809,8 @@ function RestartMathJax() {
809809 MathJax . Hub . queue . queue = [ ] ; // clear MathJax queue, so pending operations won't fire
810810 MathJax = timer = window = document = html = content = null ;
811811 ReportError ( "Timeout waiting for MathJax: restarting" ) ;
812- serverState = STATE . STOPPED ;
813812 }
813+ serverState = STATE . STOPPED ;
814814 GetWindow ( ) ;
815815 ConfigureMathJax ( ) ;
816816 StartMathJax ( ) ;
Original file line number Diff line number Diff line change 1+ var tape = require ( 'tape' ) ;
2+ var mjAPI = require ( "../lib/main.js" ) ;
3+
4+ tape ( 'basic configuration: check fontURL' , function ( t ) {
5+ t . plan ( 2 ) ;
6+
7+ var tex = 'a' ;
8+ mjAPI . typeset ( {
9+ math : tex ,
10+ format : "TeX" ,
11+ css : true
12+ } , function ( result , data ) {
13+ t . ok ( result . css . indexOf ( 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/fonts/HTML-CSS' ) > - 1 , 'Default fontURL' ) ;
14+ } ) ;
15+ // reconfigure
16+ mjAPI . typeset ( {
17+ math : ''
18+ } , function ( ) {
19+ mjAPI . config ( {
20+ fontURL : 'https://example.com'
21+ } ) ;
22+ mjAPI . start ( ) ;
23+ } )
24+ mjAPI . typeset ( {
25+ math : tex ,
26+ format : "TeX" ,
27+ css : true ,
28+ } , function ( result , data ) {
29+ t . ok ( result . css . indexOf ( 'https://example.com' ) > - 1 , 'Configuring fontURL' ) ;
30+ } ) ;
31+ } ) ;
You can’t perform that action at this time.
0 commit comments