commit 51d751f96dfd88ffca2a39d6cfd25ece811be88a
parent 2f552af02d34911a180bc882df9c40736dc846f8
Author: Emily Eisenberg <emily@khanacademy.org>
Date: Fri, 13 Mar 2015 08:09:46 -0700
Make text operators <mi>s
Summary: According to the MathML spec [about
identifiers](http://www.w3.org/TR/MathML3/chapter3.html#id.3.2.3.3),
text function names should be <mi>s. This fixes that.
Fixes #202
Test plan:
- `make test`
Auditors: alpert
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/buildMathML.js b/src/buildMathML.js
@@ -265,7 +265,7 @@ var groupTypes = {
// TODO(emily): Add a space in the middle of some of these
// operators, like \limsup.
node = new mathMLTree.MathNode(
- "mo", [new mathMLTree.TextNode(group.value.body.slice(1))]);
+ "mi", [new mathMLTree.TextNode(group.value.body.slice(1))]);
}
return node;
diff --git a/test/katex-spec.js b/test/katex-spec.js
@@ -1214,5 +1214,8 @@ describe("A MathML builder", function() {
var text = getMathML("\\text{a}").children[0].children[0];
expect(text.children[0].type).toEqual("mtext");
+
+ var textop = getMathML("\\sin").children[0].children[0];
+ expect(textop.children[0].type).toEqual("mi");
});
});