mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-12 14:38:39 +00:00
Flatten ParseNodes: "supsub" and related ("accent", "accentUnder", "horizBrace", "xarrow", "op"). (#1542)
This commit is contained in:
@@ -180,16 +180,16 @@ const svgSpan = function(
|
||||
height: number,
|
||||
} {
|
||||
let viewBoxWidth = 400000; // default
|
||||
const label = group.value.label.substr(1);
|
||||
const label = group.label.substr(1);
|
||||
if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"],
|
||||
label)) {
|
||||
// Each type in the `if` statement corresponds to one of the ParseNode
|
||||
// types below. This narrowing is required to access `grp.value.base`.
|
||||
// types below. This narrowing is required to access `grp.base`.
|
||||
// $FlowFixMe
|
||||
const grp: ParseNode<"accent"> | ParseNode<"accentUnder"> = group;
|
||||
// There are four SVG images available for each function.
|
||||
// Choose a taller image when there are more characters.
|
||||
const numChars = groupLength(grp.value.base);
|
||||
const numChars = groupLength(grp.base);
|
||||
let viewBoxHeight;
|
||||
let pathName;
|
||||
let height;
|
||||
|
Reference in New Issue
Block a user