MCPcopy Create free account
hub / github.com/TruthHun/BookStack / sizeElementFromChildren

Function sizeElementFromChildren

static/katex/katex.mjs:5554–5578  ·  view source on GitHub ↗
(elem)

Source from the content-addressed store, hash-verified

5552
5553
5554const sizeElementFromChildren = function sizeElementFromChildren(elem) {
5555 let height = 0;
5556 let depth = 0;
5557 let maxFontSize = 0;
5558
5559 for (let i = 0; i < elem.children.length; i++) {
5560 const child = elem.children[i];
5561
5562 if (child.height > height) {
5563 height = child.height;
5564 }
5565
5566 if (child.depth > depth) {
5567 depth = child.depth;
5568 }
5569
5570 if (child.maxFontSize > maxFontSize) {
5571 maxFontSize = child.maxFontSize;
5572 }
5573 }
5574
5575 elem.height = height;
5576 elem.depth = depth;
5577 elem.maxFontSize = maxFontSize;
5578};
5579/**
5580 * Makes a span with the given list of classes, list of children, and options.
5581 *

Callers 3

makeSpanFunction · 0.70
makeAnchorFunction · 0.70
makeFragmentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected