File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -867,5 +867,9 @@ exports.config = function (config) {
867867 if ( config . undefinedCharError != null ) { undefinedChar = config . undefinedCharError }
868868 if ( config . extensions != null ) { extensions = config . extensions }
869869 if ( config . fontURL != null ) { fontURL = config . fontURL }
870- if ( config . MathJax ) { MathJaxConfig = config . MathJax }
870+ if ( config . MathJax ) {
871+ // strip MathJax config blocks to avoid errors
872+ if ( config . MathJax . config ) delete config . MathJax . config
873+ MathJaxConfig = config . MathJax
874+ }
871875}
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 ( 'MathJax configuration: strip config block' , function ( t ) {
6+ t . plan ( 1 ) ;
7+ mjAPI . config ( {
8+ MathJax : {
9+ config : [ "TeX-AMS_SVG.js" ]
10+ }
11+ } ) ;
12+ mjAPI . typeset ( {
13+ math : 'E = mc^2' ,
14+ format : "TeX" ,
15+ mml : true ,
16+ } , function ( data ) {
17+ t . ok ( data , 'Config block did not cause errors' ) ;
18+ } ) ;
19+
20+ } ) ;
You can’t perform that action at this time.
0 commit comments