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

Function delimiter_makeStackedDelim

static/katex/katex.js:8216–8386  ·  view source on GitHub ↗
(delim, heightTotal, center, options, mode, classes)

Source from the content-addressed store, hash-verified

8214
8215
8216var delimiter_makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, options, mode, classes) {
8217 // There are four parts, the top, an optional middle, a repeated part, and a
8218 // bottom.
8219 var top;
8220 var middle;
8221 var repeat;
8222 var bottom;
8223 top = repeat = bottom = delim;
8224 middle = null; // Also keep track of what font the delimiters are in
8225
8226 var font = "Size1-Regular"; // We set the parts and font based on the symbol. Note that we use
8227 // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the
8228 // repeats of the arrows
8229
8230 if (delim === "\\uparrow") {
8231 repeat = bottom = "\u23D0";
8232 } else if (delim === "\\Uparrow") {
8233 repeat = bottom = "\u2016";
8234 } else if (delim === "\\downarrow") {
8235 top = repeat = "\u23D0";
8236 } else if (delim === "\\Downarrow") {
8237 top = repeat = "\u2016";
8238 } else if (delim === "\\updownarrow") {
8239 top = "\\uparrow";
8240 repeat = "\u23D0";
8241 bottom = "\\downarrow";
8242 } else if (delim === "\\Updownarrow") {
8243 top = "\\Uparrow";
8244 repeat = "\u2016";
8245 bottom = "\\Downarrow";
8246 } else if (delim === "[" || delim === "\\lbrack") {
8247 top = "\u23A1";
8248 repeat = "\u23A2";
8249 bottom = "\u23A3";
8250 font = "Size4-Regular";
8251 } else if (delim === "]" || delim === "\\rbrack") {
8252 top = "\u23A4";
8253 repeat = "\u23A5";
8254 bottom = "\u23A6";
8255 font = "Size4-Regular";
8256 } else if (delim === "\\lfloor" || delim === "\u230A") {
8257 repeat = top = "\u23A2";
8258 bottom = "\u23A3";
8259 font = "Size4-Regular";
8260 } else if (delim === "\\lceil" || delim === "\u2308") {
8261 top = "\u23A1";
8262 repeat = bottom = "\u23A2";
8263 font = "Size4-Regular";
8264 } else if (delim === "\\rfloor" || delim === "\u230B") {
8265 repeat = top = "\u23A5";
8266 bottom = "\u23A6";
8267 font = "Size4-Regular";
8268 } else if (delim === "\\rceil" || delim === "\u2309") {
8269 top = "\u23A4";
8270 repeat = bottom = "\u23A5";
8271 font = "Size4-Regular";
8272 } else if (delim === "(" || delim === "\\lparen") {
8273 top = "\u239B";

Callers 2

delimiter_makeSizedDelimFunction · 0.85

Calls 5

delimiter_getMetricsFunction · 0.85
delimiter_makeInnerFunction · 0.85
delimiter_styleWrapFunction · 0.85
fontMetricsMethod · 0.80
havingBaseStyleMethod · 0.80

Tested by

no test coverage detected