mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-10 13:38:39 +00:00
Get a tall \middle\vert from MathML (#1911)
This commit is contained in:
@@ -318,8 +318,14 @@ defineFunction({
|
||||
return middleDelim;
|
||||
},
|
||||
mathmlBuilder: (group, options) => {
|
||||
const middleNode = new mathMLTree.MathNode(
|
||||
"mo", [mml.makeText(group.delim, group.mode)]);
|
||||
// A Firefox \middle will strech a character vertically only if it
|
||||
// is in the fence part of the operator dictionary at:
|
||||
// https://www.w3.org/TR/MathML3/appendixc.html.
|
||||
// So we need to avoid U+2223 and use plain "|" instead.
|
||||
const textNode = (group.delim === "\\vert" || group.delim === "|")
|
||||
? mml.makeText("|", "text")
|
||||
: mml.makeText(group.delim, group.mode);
|
||||
const middleNode = new mathMLTree.MathNode("mo", [textNode]);
|
||||
middleNode.setAttribute("fence", "true");
|
||||
// MathML gives 5/18em spacing to each <mo> element.
|
||||
// \middle should get delimiter spacing instead.
|
||||
|
Reference in New Issue
Block a user