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

Function buildCommon_mathsym

static/katex/katex.js:5356–5375  ·  view source on GitHub ↗
(value, mode, options, classes)

Source from the content-addressed store, hash-verified

5354
5355
5356var buildCommon_mathsym = function mathsym(value, mode, options, classes) {
5357 if (classes === void 0) {
5358 classes = [];
5359 }
5360
5361 // Decide what font to render the symbol in by its entry in the symbols
5362 // table.
5363 // Have a special case for when the value = \ because the \ is used as a
5364 // textord in unsupported command errors but cannot be parsed as a regular
5365 // text ordinal and is therefore not present as a symbol in the symbols
5366 // table for text, as well as a special case for boldsymbol because it
5367 // can be used for bold + and -
5368 if (options && options.font && options.font === "boldsymbol" && buildCommon_lookupSymbol(value, "Main-Bold", mode).metrics) {
5369 return buildCommon_makeSymbol(value, "Main-Bold", mode, options, classes.concat(["mathbf"]));
5370 } else if (value === "\\" || src_symbols[mode][value].font === "main") {
5371 return buildCommon_makeSymbol(value, "Main-Regular", mode, options, classes);
5372 } else {
5373 return buildCommon_makeSymbol(value, "AMS-Regular", mode, options, classes.concat(["amsrm"]));
5374 }
5375};
5376/**
5377 * Determines which of the two font names (Main-Italic and Math-Italic) and
5378 * corresponding style tags (maindefault or mathit) to use for default math font,

Callers

nothing calls this directly

Calls 2

buildCommon_lookupSymbolFunction · 0.85
buildCommon_makeSymbolFunction · 0.85

Tested by

no test coverage detected