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

Function getOutermostNode

static/katex/katex.mjs:6410–6426  ·  view source on GitHub ↗
(node, side)

Source from the content-addressed store, hash-verified

6408
6409
6410const getOutermostNode = function getOutermostNode(node, side) {
6411 const partialGroup = checkPartialGroup(node);
6412
6413 if (partialGroup) {
6414 const children = partialGroup.children;
6415
6416 if (children.length) {
6417 if (side === "right") {
6418 return getOutermostNode(children[children.length - 1], "right");
6419 } else if (side === "left") {
6420 return getOutermostNode(children[0], "left");
6421 }
6422 }
6423 }
6424
6425 return node;
6426}; // Return math atom class (mclass) of a domTree.
6427// If `side` is given, it will get the type of the outermost node at given side.
6428
6429

Callers 1

getTypeOfDomTreeFunction · 0.70

Calls 1

checkPartialGroupFunction · 0.85

Tested by

no test coverage detected