mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 04:08:43 +00:00
Improve MathML for \limits (#1897)
* Improve MathML for \limits * Make code parallel
This commit is contained in:
@@ -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>⁡</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>⁡</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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user