Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/270858

Change subject: Add svg dimensions to the mml endpoing
......................................................................

Add svg dimensions to the mml endpoing

* This informatino is not strictly required,
 but used by the math extension.

Change-Id: If6bfbe7611f2292f7df56185f6bb6ea7fa86a559
---
M routes/mathoid.js
M test/features/math/simple.js
2 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mathoid 
refs/changes/58/270858/1

diff --git a/routes/mathoid.js b/routes/mathoid.js
index 9ce6359..b951c8e 100644
--- a/routes/mathoid.js
+++ b/routes/mathoid.js
@@ -55,7 +55,7 @@
     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 img = app.conf.img && /^mml|json|complete$/.test(outFormat);
     var speech = (outFormat !== "png") && features.speech || outFormat === 
"speech";
     var chem = type === "chem";
 
@@ -122,6 +122,9 @@
                 });
                 res.json(data).end();
                 break;
+            case 'mml':
+                outHeaders.mml['x-mathoid-style'] = data.mathoidStyle;
+            /* falls through */
             default:
                 res.set(outHeaders[outFormat]);
                 res.send(data[outFormat]).end();
diff --git a/test/features/math/simple.js b/test/features/math/simple.js
index 47c269e..00a53ed 100644
--- a/test/features/math/simple.js
+++ b/test/features/math/simple.js
@@ -303,6 +303,15 @@
                 assert.deepEqual(res.body, "upper E equals m c squared");
             });
         });
+        it("get speech text", function () {
+            return preq.post({
+                uri: baseURL + "mml",
+                body: {q: "E=mc^2"}
+            }).then(function (res) {
+                assert.status(res, 200);
+                assert.deepEqual(res.headers['x-mathoid-style'], 
'vertical-align: -0.338ex; width:9.025ex; height:2.676ex;');
+            });
+        });
     });
 
 });

-- 
To view, visit https://gerrit.wikimedia.org/r/270858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6bfbe7611f2292f7df56185f6bb6ea7fa86a559
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mathoid
Gerrit-Branch: master
Gerrit-Owner: Physikerwelt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to