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

Function buildHTMLUnbreakable

static/katex/katex.mjs:6482–6497  ·  view source on GitHub ↗

* Combine an array of HTML DOM nodes (e.g., the output of `buildExpression`) * into an unbreakable HTML node of class .base, with proper struts to * guarantee correct vertical extent. `buildHTML` calls this repeatedly to * make up the entire expression as a sequence of unbreakable units.

(children, options)

Source from the content-addressed store, hash-verified

6480 */
6481
6482function buildHTMLUnbreakable(children, options) {
6483 // Compute height and depth of this chunk.
6484 const body = makeSpan$1(["base"], children, options); // Add strut, which ensures that the top of the HTML element falls at
6485 // the height of the expression, and the bottom of the HTML element
6486 // falls at the depth of the expression.
6487 // We used to have separate top and bottom struts, where the bottom strut
6488 // would like to use `vertical-align: top`, but in IE 9 this lowers the
6489 // baseline of the box to the bottom of this strut (instead of staying in
6490 // the normal place) so we use an absolute value for vertical-align instead.
6491
6492 const strut = makeSpan$1(["strut"]);
6493 strut.style.height = body.height + body.depth + "em";
6494 strut.style.verticalAlign = -body.depth + "em";
6495 body.children.unshift(strut);
6496 return body;
6497}
6498/**
6499 * Take an entire parse tree, and build it into an appropriate set of HTML
6500 * nodes.

Callers 1

buildHTMLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected