Skip to content

Commit

Permalink
Add svg dimensions to the mml endpoing
Browse files Browse the repository at this point in the history
* This informatino is not strictly required,
 but used by the math extension.

Change-Id: If6bfbe7611f2292f7df56185f6bb6ea7fa86a559
  • Loading branch information
physikerwelt committed Feb 16, 2016
1 parent 0837b04 commit b0a13b7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mathoid",
"version": "0.4.1",
"version": "0.4.2",
"description": "Render TeX to SVG and MathML using MathJax. Based on svgtex.",
"main": "./app.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion routes/mathoid.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function handleRequest(res, q, type, outFormat, features) {
var svg = app.conf.svg && /^svg|json|complete$/.test(outFormat);
var mml = (type !== "MathML") && /^mml|json|complete$/.test(outFormat);
var png = app.conf.png && /^png|json|complete$/.test(outFormat);
var img = app.conf.img && /^json|complete$/.test(outFormat);
var info = app.conf.texvcinfo && /^graph|texvcinfo$/.test(outFormat);
var img = app.conf.img && /^mml|json|complete$/.test(outFormat);
var speech = (outFormat !== "png") && features.speech || outFormat === "speech";
var chem = type === "chem";

Expand Down Expand Up @@ -125,6 +125,10 @@ function handleRequest(res, q, type, outFormat, features) {
});
res.json(data).end();
break;
case 'mml':
res.set(Object.assign({}, outHeaders.mml, {'x-mathoid-style': data.mathoidStyle}));
res.send(data.mml).end();
break;
default:
res.set(outHeaders[outFormat]);
res.send(data[outFormat]).end();
Expand Down
9 changes: 9 additions & 0 deletions test/features/math/no-check.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions test/features/math/simple.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b0a13b7

Please sign in to comment.