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

Function makeCustomSizedDelim

static/katex/katex.mjs:8528–8560  ·  view source on GitHub ↗
(delim, height, center, options, mode, classes)

Source from the content-addressed store, hash-verified

8526
8527
8528const makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, options, mode, classes) {
8529 if (delim === "<" || delim === "\\lt" || delim === "\u27e8") {
8530 delim = "\\langle";
8531 } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") {
8532 delim = "\\rangle";
8533 } // Decide what sequence to use
8534
8535
8536 let sequence;
8537
8538 if (utils.contains(stackNeverDelimiters, delim)) {
8539 sequence = stackNeverDelimiterSequence;
8540 } else if (utils.contains(stackLargeDelimiters, delim)) {
8541 sequence = stackLargeDelimiterSequence;
8542 } else {
8543 sequence = stackAlwaysDelimiterSequence;
8544 } // Look through the sequence
8545
8546
8547 const delimType = traverseSequence(delim, height, sequence, options); // Get the delimiter from font glyphs.
8548 // Depending on the sequence element we decided on, call the
8549 // appropriate function.
8550
8551 if (delimType.type === "small") {
8552 return makeSmallDelim(delim, delimType.style, center, options, mode, classes);
8553 } else if (delimType.type === "large") {
8554 return makeLargeDelim(delim, delimType.size, center, options, mode, classes);
8555 } else
8556 /* if (delimType.type === "stack") */
8557 {
8558 return makeStackedDelim(delim, height, center, options, mode, classes);
8559 }
8560};
8561/**
8562 * Make a delimiter for use with `\left` and `\right`, given a height and depth
8563 * of an expression that the delimiters surround.

Callers 1

makeLeftRightDelimFunction · 0.85

Calls 4

makeSmallDelimFunction · 0.85
makeLargeDelimFunction · 0.85
makeStackedDelimFunction · 0.85
traverseSequenceFunction · 0.70

Tested by

no test coverage detected