Flatten ParseNodes: "supsub" and related ("accent", "accentUnder", "horizBrace", "xarrow", "op"). (#1542)

This commit is contained in:
Ashish Myles
2018-08-03 01:06:02 -04:00
committed by ylemkimon
parent c7145f0ff0
commit fd6690b988
16 changed files with 215 additions and 278 deletions

View File

@@ -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;