Skip to content

Commit 1ff9d60

Browse files
authored
Merge pull request #282 from mathjax/issue277
[main] mmlNode should force mml
2 parents c431e57 + 500c1b1 commit 1ff9d60

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ function GetMML(result) {
537537
}
538538
}
539539
try {
540-
if (data.mml) result.mml = jax.root.toMathML('',jax);
540+
result.mml = jax.root.toMathML('',jax);
541541
if (data.mmlNode) result.mmlNode = jsdom(result.mml).body.firstChild;
542542
} catch(err) {
543543
if (!err.restart) {throw err;} // an actual error

test/issue277.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var tape = require('tape');
2+
var mjAPI = require("../lib/main.js");
3+
4+
tape('mmlNode should enable mml', function(t) {
5+
t.plan(1);
6+
mjAPI.start();
7+
var tex = 'x';
8+
9+
mjAPI.typeset({
10+
math: tex,
11+
format: "TeX",
12+
mmlNode: true
13+
}, function(data) {
14+
t.ok(data.mml, 'MathML generated');
15+
});
16+
});

0 commit comments

Comments
 (0)