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

Function sizeElementFromChildren

static/katex/katex.js:5583–5607  ·  view source on GitHub ↗
(elem)

Source from the content-addressed store, hash-verified

5581
5582
5583var sizeElementFromChildren = function sizeElementFromChildren(elem) {
5584 var height = 0;
5585 var depth = 0;
5586 var maxFontSize = 0;
5587
5588 for (var i = 0; i < elem.children.length; i++) {
5589 var child = elem.children[i];
5590
5591 if (child.height > height) {
5592 height = child.height;
5593 }
5594
5595 if (child.depth > depth) {
5596 depth = child.depth;
5597 }
5598
5599 if (child.maxFontSize > maxFontSize) {
5600 maxFontSize = child.maxFontSize;
5601 }
5602 }
5603
5604 elem.height = height;
5605 elem.depth = depth;
5606 elem.maxFontSize = maxFontSize;
5607};
5608/**
5609 * Makes a span with the given list of classes, list of children, and options.
5610 *

Callers 3

buildCommon_makeSpanFunction · 0.70
buildCommon_makeAnchorFunction · 0.70
buildCommon_makeFragmentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected