MCPcopy Index your code
hub / github.com/TruthHun/BookStack / sizingGroup

Function sizingGroup

static/katex/katex.mjs:11743–11765  ·  view source on GitHub ↗
(value, options, baseOptions)

Source from the content-addressed store, hash-verified

11741});
11742
11743function sizingGroup(value, options, baseOptions) {
11744 const inner = buildExpression(value, options, false);
11745 const multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; // Add size-resetting classes to the inner list and set maxFontSize
11746 // manually. Handle nested size changes.
11747
11748 for (let i = 0; i < inner.length; i++) {
11749 const pos = inner[i].classes.indexOf("sizing");
11750
11751 if (pos < 0) {
11752 Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions));
11753 } else if (inner[i].classes[pos + 1] === "reset-size" + options.size) {
11754 // This is a nested size change: e.g., inner[i] is the "b" in
11755 // `\Huge a \small b`. Override the old size (the `reset-` class)
11756 // but not the new size.
11757 inner[i].classes[pos + 1] = "reset-size" + baseOptions.size;
11758 }
11759
11760 inner[i].height *= multiplier;
11761 inner[i].depth *= multiplier;
11762 }
11763
11764 return buildCommon.makeFragment(inner);
11765}
11766const sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"];
11767const htmlBuilder$9 = (group, options) => {
11768 // Handle sizing operators like \Huge. Real TeX doesn't actually allow

Callers 2

htmlBuilder$9Function · 0.70
htmlBuilderFunction · 0.70

Calls 2

buildExpressionFunction · 0.85
sizingClassesMethod · 0.80

Tested by

no test coverage detected