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

Class Style

static/katex/katex.mjs:366–435  ·  view source on GitHub ↗

* The main style class. Contains a unique id for the style, a size (which is * the same for cramped and uncramped version of a style), and a cramped flag.

Source from the content-addressed store, hash-verified

364 * the same for cramped and uncramped version of a style), and a cramped flag.
365 */
366class Style {
367 constructor(id, size, cramped) {
368 this.id = void 0;
369 this.size = void 0;
370 this.cramped = void 0;
371 this.id = id;
372 this.size = size;
373 this.cramped = cramped;
374 }
375 /**
376 * Get the style of a superscript given a base in the current style.
377 */
378
379
380 sup() {
381 return styles[sup[this.id]];
382 }
383 /**
384 * Get the style of a subscript given a base in the current style.
385 */
386
387
388 sub() {
389 return styles[sub[this.id]];
390 }
391 /**
392 * Get the style of a fraction numerator given the fraction in the current
393 * style.
394 */
395
396
397 fracNum() {
398 return styles[fracNum[this.id]];
399 }
400 /**
401 * Get the style of a fraction denominator given the fraction in the current
402 * style.
403 */
404
405
406 fracDen() {
407 return styles[fracDen[this.id]];
408 }
409 /**
410 * Get the cramped version of a style (in particular, cramping a cramped style
411 * doesn't change the style).
412 */
413
414
415 cramp() {
416 return styles[cramp[this.id]];
417 }
418 /**
419 * Get a text or display version of this style.
420 */
421
422
423 text() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected