Skip to content

Commit

Permalink
Merge pull request #328 from mathjax/develop
Browse files Browse the repository at this point in the history
1.0.3 release
  • Loading branch information
pkra authored May 2, 2017
2 parents 356e3cd + 1bd9351 commit 2f4bf95
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
13 changes: 7 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ function ConfigureMathJax() {
jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/SVG", "output/CommonHTML"],
extensions: ["toMathML.js"],
TeX: {extensions: window.Array("AMSmath.js","AMSsymbols.js","autoload-all.js")},
tex2jax: {inlineMath: [['$','$'],['\\(','\\)']], preview:"none"},
mml2jax: {preview:"none"},
asciimath2jax: {preview:"none"},
SVG: {useFontCache: true, useGlobalCache: false, EqnChunk: 1000000, EqnDelay: 0},
CommonHTML: {EqnChunk: 1000000, EqnDelay: 0, undefinedFamily:"monospace"},

Expand Down Expand Up @@ -473,7 +470,11 @@ function ConfigureMathJax() {
}
if (MathJaxConfig) {
adjustArrays(MathJaxConfig);
Insert(window.MathJax,MathJaxConfig);
// merge the defaults into the user configuration (to sanitize)
window.MathJax = Insert(Insert({},MathJaxConfig),window.MathJax);
if (MathJaxConfig.extensions) {
window.MathJax.extensions = window.MathJax.extensions.concat(MathJaxConfig.extensions);
}
}
}

Expand Down Expand Up @@ -656,7 +657,7 @@ function StartQueue() {

//
// Get the math data and callback
// and set the content with the proper delimiters
// and set the content with the proper script type
//
var item = queue.shift();
data = item[0]; callback = item[1];
Expand Down Expand Up @@ -696,7 +697,7 @@ function StartQueue() {
timer = setTimeout(RestartMathJax,data.timeout);
HUB.Queue(
$$(SetRenderer,renderer),
$$("Typeset",HUB),
$$("Process",HUB),
$$(TypesetDone,result),
$$(GetSpeech,result),
$$(GetMML,result),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mathjax-node",
"version": "1.0.2",
"version": "1.0.3",
"description": "API's for calling MathJax from node.js",
"keywords": [
"MathJax",
Expand Down
20 changes: 20 additions & 0 deletions test/userconfig-jax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var tape = require('tape');
var mjAPI = require('../lib/main.js');
var jsdom = require('jsdom').jsdom;

tape('User configuration with jax array', function (t) {
t.plan(1);

mjAPI.config({
MathJax: {
jax: ["input/MathML", "output/SVG"]
}
});
mjAPI.typeset({
math: '<math><mn>1</mn></math>',
format: 'MathML',
svg: true
}, function (data) {
t.ok(!data.errors, 'No errors');
});
});

0 comments on commit 2f4bf95

Please sign in to comment.