mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 20:28:38 +00:00
Fix ApplyFunction character (#1890)
This commit is contained in:
@@ -99,6 +99,7 @@ defineFunction({
|
||||
mode: baseArg.mode,
|
||||
limits: true,
|
||||
alwaysHandleSupSub: true,
|
||||
parentIsSupSub: false,
|
||||
symbol: false,
|
||||
suppressBaseShift: funcName !== "\\stackrel",
|
||||
body: ordargument(baseArg),
|
||||
|
@@ -252,15 +252,19 @@ 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))]);
|
||||
if (group.parentIsSupSub) {
|
||||
node = new mathMLTree.MathNode(
|
||||
"mo", [new mathMLTree.TextNode(group.name.slice(1))]);
|
||||
} 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")]);
|
||||
|
||||
// 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]);
|
||||
return mathMLTree.newDocumentFragment([node, operator]);
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
@@ -302,6 +306,7 @@ defineFunction({
|
||||
type: "op",
|
||||
mode: parser.mode,
|
||||
limits: true,
|
||||
parentIsSupSub: false,
|
||||
symbol: true,
|
||||
name: fName,
|
||||
};
|
||||
@@ -324,6 +329,7 @@ defineFunction({
|
||||
type: "op",
|
||||
mode: parser.mode,
|
||||
limits: false,
|
||||
parentIsSupSub: false,
|
||||
symbol: false,
|
||||
body: ordargument(body),
|
||||
};
|
||||
@@ -363,6 +369,7 @@ defineFunction({
|
||||
type: "op",
|
||||
mode: parser.mode,
|
||||
limits: false,
|
||||
parentIsSupSub: false,
|
||||
symbol: false,
|
||||
name: funcName,
|
||||
};
|
||||
@@ -385,6 +392,7 @@ defineFunction({
|
||||
type: "op",
|
||||
mode: parser.mode,
|
||||
limits: true,
|
||||
parentIsSupSub: false,
|
||||
symbol: false,
|
||||
name: funcName,
|
||||
};
|
||||
@@ -412,6 +420,7 @@ defineFunction({
|
||||
type: "op",
|
||||
mode: parser.mode,
|
||||
limits: false,
|
||||
parentIsSupSub: false,
|
||||
symbol: true,
|
||||
name: fName,
|
||||
};
|
||||
|
@@ -201,6 +201,10 @@ defineFunctionBuilders({
|
||||
}
|
||||
}
|
||||
|
||||
if (group.base && group.base.type === "op") {
|
||||
group.base.parentIsSupSub = true;
|
||||
}
|
||||
|
||||
const children = [mml.buildGroup(group.base, options)];
|
||||
|
||||
if (group.sub) {
|
||||
|
@@ -66,6 +66,7 @@ type ParseNodeTypes = {
|
||||
limits: boolean,
|
||||
alwaysHandleSupSub?: boolean,
|
||||
suppressBaseShift?: boolean,
|
||||
parentIsSupSub: boolean,
|
||||
symbol: boolean,
|
||||
name: string,
|
||||
body?: void,
|
||||
@@ -76,6 +77,7 @@ type ParseNodeTypes = {
|
||||
limits: boolean,
|
||||
alwaysHandleSupSub?: boolean,
|
||||
suppressBaseShift?: boolean,
|
||||
parentIsSupSub: boolean,
|
||||
symbol: false, // If 'symbol' is true, `body` *must* be set.
|
||||
name?: void,
|
||||
body: AnyParseNode[],
|
||||
|
Reference in New Issue
Block a user