From 51d751f96dfd88ffca2a39d6cfd25ece811be88a Mon Sep 17 00:00:00 2001 From: Emily Eisenberg Date: Fri, 13 Mar 2015 08:09:46 -0700 Subject: [PATCH] Make text operators 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 s. This fixes that. Fixes #202 Test plan: - `make test` Auditors: alpert --- src/buildMathML.js | 2 +- test/katex-spec.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/buildMathML.js b/src/buildMathML.js index cd29c2748..3fb89b047 100644 --- 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 index 1b531d52d..6aab20d7d 100644 --- 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"); }); });