Skip to content

Commit c5a50ce

Browse files
authored
Merge pull request #393 from mathjax/issue392
Define the None output jax after the other jax are loaded
2 parents 2db9bc0 + 5d97f48 commit c5a50ce

2 files changed

Lines changed: 33 additions & 7 deletions

File tree

lib/main.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -486,14 +486,16 @@ function ConfigureMathJax() {
486486
//
487487
// Set up None output jax (for when only MathML output is needed)
488488
//
489-
MathJax.OutputJax.None = MathJax.OutputJax({
490-
id: "None",
491-
preTranslate: function () {},
492-
Translate: function () {},
493-
postTranslate: function () {}
489+
MathJax.Hub.Register.StartupHook("End Jax", function () {
490+
MathJax.OutputJax.None = MathJax.OutputJax({
491+
id: "None",
492+
preTranslate: function () {},
493+
Translate: function () {},
494+
postTranslate: function () {}
495+
});
496+
MathJax.OutputJax.None.loadComplete("jax.js");
497+
MathJax.OutputJax.None.Register("jax/mml");
494498
});
495-
MathJax.OutputJax.None.loadComplete("jax.js");
496-
MathJax.OutputJax.None.Register("jax/mml");
497499

498500
//
499501
// Reset the color extension after `autoload-all`

test/useFontCache.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var tape = require('tape');
2+
var mjAPI = require("../lib/main.js");
3+
4+
tape('basic configuration: useFontCache', function (t) {
5+
t.plan(2);
6+
7+
var tex = 'a';
8+
mjAPI.typeset({
9+
math: tex,
10+
format: "TeX",
11+
svg: true,
12+
useFontCache: false
13+
}, function (result, data) {
14+
t.ok(result.svg.indexOf('<use') === -1, 'useFontCache set to false');
15+
});
16+
mjAPI.typeset({
17+
math: tex,
18+
format: "TeX",
19+
svg: true,
20+
useFontCache: true
21+
}, function (result, data) {
22+
t.ok(result.svg.indexOf('<use') > -1, 'useFontCache set to true');
23+
});
24+
});

0 commit comments

Comments
 (0)