Improve MathML for \limits (#1897)

* Improve MathML for \limits

* Make code parallel
This commit is contained in:
Ron Kok
2019-03-23 21:02:12 -07:00
committed by ylemkimon
parent f8f4809886
commit cb477ca01a

View File

@@ -252,18 +252,16 @@ const mathmlBuilder: MathMLBuilder<"op"> = (group, options) => {
// operator's name.
// TODO(emily): Add a space in the middle of some of these
// operators, like \limsup.
node = new mathMLTree.MathNode(
"mi", [new mathMLTree.TextNode(group.name.slice(1))]);
// Append an <mo>&ApplyFunction;</mo>.
// ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
const operator = new mathMLTree.MathNode("mo",
[mml.makeText("\u2061", "text")]);
if (group.parentIsSupSub) {
node = new mathMLTree.MathNode(
"mo", [new mathMLTree.TextNode(group.name.slice(1))]);
node = new mathMLTree.MathNode("mo", [node, operator]);
} else {
node = new mathMLTree.MathNode(
"mi", [new mathMLTree.TextNode(group.name.slice(1))]);
// Append an <mo>&ApplyFunction;</mo>.
// ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
const operator = new mathMLTree.MathNode("mo",
[mml.makeText("\u2061", "text")]);
return mathMLTree.newDocumentFragment([node, operator]);
node = mathMLTree.newDocumentFragment([node, operator]);
}
}