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

Function buildHTMLUnbreakable

static/katex/katex.js:6528–6543  ·  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

6526 */
6527
6528function buildHTMLUnbreakable(children, options) {
6529 // Compute height and depth of this chunk.
6530 var body = buildHTML_makeSpan(["base"], children, options); // Add strut, which ensures that the top of the HTML element falls at
6531 // the height of the expression, and the bottom of the HTML element
6532 // falls at the depth of the expression.
6533 // We used to have separate top and bottom struts, where the bottom strut
6534 // would like to use `vertical-align: top`, but in IE 9 this lowers the
6535 // baseline of the box to the bottom of this strut (instead of staying in
6536 // the normal place) so we use an absolute value for vertical-align instead.
6537
6538 var strut = buildHTML_makeSpan(["strut"]);
6539 strut.style.height = body.height + body.depth + "em";
6540 strut.style.verticalAlign = -body.depth + "em";
6541 body.children.unshift(strut);
6542 return body;
6543}
6544/**
6545 * Take an entire parse tree, and build it into an appropriate set of HTML
6546 * nodes.

Callers 1

buildHTMLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected