mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Append ApplyFunction to math functions (#960)
* Append ApplyFunction to math functions As described at: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4 Character U+2061 is the same as ⁡. Ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp * Add comment for \u2061
This commit is contained in:
@@ -209,8 +209,12 @@ const mathmlBuilder = (group, options) => {
|
||||
node = new mathMLTree.MathNode(
|
||||
"mi", [new mathMLTree.TextNode(group.value.body.slice(1))]);
|
||||
|
||||
// TODO(ron): Append an <mo>⁡</mo> as in \operatorname
|
||||
// ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.2
|
||||
// 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 new domTree.documentFragment([node, operator]);
|
||||
}
|
||||
|
||||
return node;
|
||||
|
@@ -68,8 +68,10 @@ defineFunction({
|
||||
const identifier = new mathMLTree.MathNode("mi", output);
|
||||
identifier.setAttribute("mathvariant", "normal");
|
||||
|
||||
// \u2061 is the same as ⁡
|
||||
// ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp
|
||||
const operator = new mathMLTree.MathNode("mo",
|
||||
[mml.makeText("⁡", "text")]);
|
||||
[mml.makeText("\u2061", "text")]);
|
||||
|
||||
return new domTree.documentFragment([identifier, operator]);
|
||||
},
|
||||
|
@@ -27,6 +27,9 @@ exports[`A MathML builder should generate the right types of nodes 1`] = `
|
||||
<mi>
|
||||
sin
|
||||
</mi>
|
||||
<mo>
|
||||
|
||||
</mo>
|
||||
<mrow>
|
||||
<mi>
|
||||
x
|
||||
|
Reference in New Issue
Block a user